mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-03 11:39:17 +01:00
mining: add new getCoinbaseTx() returning a struct
Introduce a new method intended to replace getCoinbaseRawTx(), which provides a struct with everything clients need to construct a coinbase. This is safer than providing a raw dummy coinbase that clients then have to manipulate. The CoinbaseTx data is populated during the dummy transaction generation and stored in struct CBlockTemplate. Expand the interface_ipc.py functional test to document its usage and ensure equivalence.
This commit is contained in:
@@ -84,6 +84,7 @@ using interfaces::WalletLoader;
|
||||
using kernel::ChainstateRole;
|
||||
using node::BlockAssembler;
|
||||
using node::BlockWaitOptions;
|
||||
using node::CoinbaseTx;
|
||||
using util::Join;
|
||||
|
||||
namespace node {
|
||||
@@ -893,6 +894,11 @@ public:
|
||||
return m_block_template->block.vtx[0];
|
||||
}
|
||||
|
||||
CoinbaseTx getCoinbaseTx() override
|
||||
{
|
||||
return m_block_template->m_coinbase_tx;
|
||||
}
|
||||
|
||||
std::vector<unsigned char> getCoinbaseCommitment() override
|
||||
{
|
||||
return m_block_template->vchCoinbaseCommitment;
|
||||
|
||||
Reference in New Issue
Block a user