Skip to content

Commit a62cb70

Browse files
committed
mining: rename getCoinbaseTx() to ..RawTx()
This frees up the name getCoinbaseTx() for the next commit. Changing a function name does not impact IPC clients, as they only consider the function signature and sequence number.
1 parent 2bbdcf6 commit a62cb70

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

src/interfaces/mining.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,19 @@ class BlockTemplate
3838
// Sigop cost per transaction, not including coinbase transaction.
3939
virtual std::vector<int64_t> getTxSigops() = 0;
4040

41-
virtual CTransactionRef getCoinbaseTx() = 0;
41+
/**
42+
* Return serialized dummy coinbase transaction.
43+
*/
44+
virtual CTransactionRef getCoinbaseRawTx() = 0;
45+
46+
/**
47+
* Return scriptPubKey with SegWit OP_RETURN.
48+
*/
4249
virtual std::vector<unsigned char> getCoinbaseCommitment() = 0;
50+
51+
/**
52+
* Return which output in the dummy coinbase contains the SegWit OP_RETURN.
53+
*/
4354
virtual int getWitnessCommitmentIndex() = 0;
4455

4556
/**

src/ipc/capnp/mining.capnp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") {
2727
getBlock @2 (context: Proxy.Context) -> (result: Data);
2828
getTxFees @3 (context: Proxy.Context) -> (result: List(Int64));
2929
getTxSigops @4 (context: Proxy.Context) -> (result: List(Int64));
30-
getCoinbaseTx @5 (context: Proxy.Context) -> (result: Data);
30+
getCoinbaseRawTx @5 (context: Proxy.Context) -> (result: Data);
3131
getCoinbaseCommitment @6 (context: Proxy.Context) -> (result: Data);
3232
getWitnessCommitmentIndex @7 (context: Proxy.Context) -> (result: Int32);
3333
getCoinbaseMerklePath @8 (context: Proxy.Context) -> (result: List(Data));

src/sv2/template_provider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ bool Sv2TemplateProvider::SendWork(Sv2Client& client, uint64_t template_id, Bloc
576576
}
577577

578578
node::Sv2NewTemplateMsg new_template{header,
579-
block_template.getCoinbaseTx(),
579+
block_template.getCoinbaseRawTx(),
580580
block_template.getCoinbaseMerklePath(),
581581
template_id,
582582
future_template};

src/test/sv2_mock_mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CBlockHeader MockBlockTemplate::getBlockHeader() { return block.GetBlockHeader()
5656
CBlock MockBlockTemplate::getBlock() { return block; }
5757
std::vector<CAmount> MockBlockTemplate::getTxFees() { return {}; }
5858
std::vector<int64_t> MockBlockTemplate::getTxSigops() { return {}; }
59-
CTransactionRef MockBlockTemplate::getCoinbaseTx() { return block.vtx[0]; }
59+
CTransactionRef MockBlockTemplate::getCoinbaseRawTx() { return block.vtx[0]; }
6060
std::vector<unsigned char> MockBlockTemplate::getCoinbaseCommitment() { return {}; }
6161
int MockBlockTemplate::getWitnessCommitmentIndex() { return -1; }
6262
std::vector<uint256> MockBlockTemplate::getCoinbaseMerklePath() { return {}; }

src/test/sv2_mock_mining.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class MockBlockTemplate : public interfaces::BlockTemplate {
5858
CBlock getBlock() override;
5959
std::vector<CAmount> getTxFees() override;
6060
std::vector<int64_t> getTxSigops() override;
61-
CTransactionRef getCoinbaseTx() override;
61+
CTransactionRef getCoinbaseRawTx() override;
6262
std::vector<unsigned char> getCoinbaseCommitment() override;
6363
int getWitnessCommitmentIndex() override;
6464
std::vector<uint256> getCoinbaseMerklePath() override;

0 commit comments

Comments
 (0)