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.
This commit is contained in:
Sjors Provoost 2025-12-03 13:01:27 +01:00
parent 516ae5ede4
commit d59b4cdb57
No known key found for this signature in database
GPG Key ID: 57FF9BDBCC301009
5 changed files with 21 additions and 5 deletions

View File

@ -0,0 +1,5 @@
Mining IPC
----------
- The `getCoinbaseTx()` method is renamed to `getCoinbaseRawTx()`.
IPC clients do not use the function name, so they're not affected. (#33819)

View File

@ -42,8 +42,19 @@ public:
// Sigop cost per transaction, not including coinbase transaction.
virtual std::vector<int64_t> getTxSigops() = 0;
virtual CTransactionRef getCoinbaseTx() = 0;
/**
* Return serialized dummy coinbase transaction.
*/
virtual CTransactionRef getCoinbaseRawTx() = 0;
/**
* Return scriptPubKey with SegWit OP_RETURN.
*/
virtual std::vector<unsigned char> getCoinbaseCommitment() = 0;
/**
* Return which output in the dummy coinbase contains the SegWit OP_RETURN.
*/
virtual int getWitnessCommitmentIndex() = 0;
/**

View File

@ -27,7 +27,7 @@ interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") {
getBlock @2 (context: Proxy.Context) -> (result: Data);
getTxFees @3 (context: Proxy.Context) -> (result: List(Int64));
getTxSigops @4 (context: Proxy.Context) -> (result: List(Int64));
getCoinbaseTx @5 (context: Proxy.Context) -> (result: Data);
getCoinbaseRawTx @5 (context: Proxy.Context) -> (result: Data);
getCoinbaseCommitment @6 (context: Proxy.Context) -> (result: Data);
getWitnessCommitmentIndex @7 (context: Proxy.Context) -> (result: Int32);
getCoinbaseMerklePath @8 (context: Proxy.Context) -> (result: List(Data));

View File

@ -888,7 +888,7 @@ public:
return m_block_template->vTxSigOpsCost;
}
CTransactionRef getCoinbaseTx() override
CTransactionRef getCoinbaseRawTx() override
{
return m_block_template->block.vtx[0];
}

View File

@ -123,7 +123,7 @@ class IPCInterfaceTest(BitcoinTestFramework):
return block
async def parse_and_deserialize_coinbase_tx(self, block_template, ctx):
coinbase_data = BytesIO((await block_template.getCoinbaseTx(ctx)).result)
coinbase_data = BytesIO((await block_template.getCoinbaseRawTx(ctx)).result)
tx = CTransaction()
tx.deserialize(coinbase_data)
return tx
@ -191,7 +191,7 @@ class IPCInterfaceTest(BitcoinTestFramework):
assert_equal(len(txfees.result), 0)
txsigops = await template.getTxSigops(ctx)
assert_equal(len(txsigops.result), 0)
coinbase_data = BytesIO((await template.getCoinbaseTx(ctx)).result)
coinbase_data = BytesIO((await template.getCoinbaseRawTx(ctx)).result)
coinbase = CTransaction()
coinbase.deserialize(coinbase_data)
assert_equal(coinbase.vin[0].prevout.hash, 0)