Skip to content

Commit 4d57288

Browse files
committed
refactor: use CTransactionRef in submitSolution
1 parent 2e81791 commit 4d57288

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/interfaces/mining.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class BlockTemplate
5555
*
5656
* @returns if the block was processed, independent of block validity
5757
*/
58-
virtual bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CMutableTransaction coinbase) = 0;
58+
virtual bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CTransactionRef coinbase) = 0;
5959
};
6060

6161
//! Interface giving clients (RPC, Stratum v2 Template Provider in the future)

src/node/interfaces.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -916,16 +916,14 @@ class BlockTemplateImpl : public BlockTemplate
916916
return TransactionMerklePath(m_block_template->block, 0);
917917
}
918918

919-
bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CMutableTransaction coinbase) override
919+
bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CTransactionRef coinbase) override
920920
{
921921
CBlock block{m_block_template->block};
922922

923-
auto cb = MakeTransactionRef(std::move(coinbase));
924-
925923
if (block.vtx.size() == 0) {
926-
block.vtx.push_back(cb);
924+
block.vtx.push_back(coinbase);
927925
} else {
928-
block.vtx[0] = cb;
926+
block.vtx[0] = coinbase;
929927
}
930928

931929
block.nVersion = version;

0 commit comments

Comments
 (0)