aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2024-10-31 11:05:05 -0700
committerSjors Provoost <sjors@sprovoost.nl>2024-12-17 10:12:31 +0700
commit4d572882463b20818fcfbd0a2f6fa6c0168e4e4a (patch)
tree2dc7a2d4905a40524155beaad8d97f42f21663c6 /src
parent2e81791d907288c174aa05dc1b3816e6d988127c (diff)
refactor: use CTransactionRef in submitSolution
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/mining.h2
-rw-r--r--src/node/interfaces.cpp8
2 files changed, 4 insertions, 6 deletions
diff --git a/src/interfaces/mining.h b/src/interfaces/mining.h
index 6f23bf3bb5..05d1ee7e7b 100644
--- a/src/interfaces/mining.h
+++ b/src/interfaces/mining.h
@@ -55,7 +55,7 @@ public:
*
* @returns if the block was processed, independent of block validity
*/
- virtual bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CMutableTransaction coinbase) = 0;
+ virtual bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CTransactionRef coinbase) = 0;
};
//! Interface giving clients (RPC, Stratum v2 Template Provider in the future)
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
index f2518298c0..26d2fcb1c6 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -916,16 +916,14 @@ public:
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;