diff --git a/src/miner.cpp b/src/miner.cpp index edfabb526a..03840a0b4c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -118,7 +118,7 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc if(!pblocktemplate.get()) return nullptr; - pblock = &pblocktemplate->block; // pointer for convenience + CBlock* const pblock = &pblocktemplate->block; // pointer for convenience // Add dummy coinbase tx as first transaction pblock->vtx.emplace_back(); @@ -281,7 +281,7 @@ bool BlockAssembler::TestPackageTransactions(const CTxMemPool::setEntries& packa void BlockAssembler::AddToBlock(CTxMemPool::txiter iter) { - pblock->vtx.emplace_back(iter->GetSharedTx()); + pblocktemplate->block.vtx.emplace_back(iter->GetSharedTx()); pblocktemplate->vTxFees.push_back(iter->GetFee()); pblocktemplate->vTxSigOps.push_back(iter->GetSigOpCount()); nBlockSize += iter->GetTxSize(); diff --git a/src/miner.h b/src/miner.h index f9de50e35f..942063f66d 100644 --- a/src/miner.h +++ b/src/miner.h @@ -129,8 +129,6 @@ class BlockAssembler private: // The constructed block template std::unique_ptr pblocktemplate; - // A convenience pointer that always refers to the CBlock in pblocktemplate - CBlock* pblock; // Configuration parameters for the block size unsigned int nBlockMaxSize;