diff --git a/src/interfaces/mining.h b/src/interfaces/mining.h index 6f23bf3bb55..05d1ee7e7b0 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 f2518298c0e..26d2fcb1c63 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;