mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-03 17:30:25 +01:00
Merge bitcoin/bitcoin#31197: refactor: mining interface 30955 followups
f86678156aCheck leaves size maximum in MerkleComputation (Sjors Provoost)4d57288246refactor: use CTransactionRef in submitSolution (Sjors Provoost)2e81791d90Drop TransactionMerklePath default position arg (Sjors Provoost)39d3b538e6Rename merkle branch to path (Sjors Provoost) Pull request description: This PR implements the refactors suggested in https://github.com/bitcoin/bitcoin/pull/30955#pullrequestreview-2354931253. ACKs for top commit: tdb3: code review re-ACKf86678156aitornaza: re ACKf86678156aryanofsky: Code review ACKf86678156aonly changes since last review are a whitespace change and adding an Assume statement to check for size_t -> uint32_t overflows Tree-SHA512: 661b5d5d0e24b2269bf33ab1484e37c36e67b32a7796d77ca3b1856d3043378b081ad43c32a8638b46fa8c0de51c823fd9747dd9fc81f958f20d327bf330a47c
This commit is contained in:
@@ -913,19 +913,17 @@ public:
|
||||
|
||||
std::vector<uint256> getCoinbaseMerklePath() override
|
||||
{
|
||||
return BlockMerkleBranch(m_block_template->block);
|
||||
return TransactionMerklePath(m_block_template->block, 0);
|
||||
}
|
||||
|
||||
bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CMutableTransaction coinbase) override
|
||||
bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CTransactionRef coinbase) override
|
||||
{
|
||||
CBlock block{m_block_template->block};
|
||||
|
||||
auto cb = MakeTransactionRef(std::move(coinbase));
|
||||
|
||||
if (block.vtx.size() == 0) {
|
||||
block.vtx.push_back(cb);
|
||||
block.vtx.push_back(coinbase);
|
||||
} else {
|
||||
block.vtx[0] = cb;
|
||||
block.vtx[0] = coinbase;
|
||||
}
|
||||
|
||||
block.nVersion = version;
|
||||
|
||||
Reference in New Issue
Block a user