diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-09 20:24:13 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-07-09 20:24:17 +0200 |
commit | 2aaff4813cc340764c99846513d58fc3553fcb6a (patch) | |
tree | cb2adcfd23b553247e5a05050a67d6122dd8ee38 | |
parent | fd9db45c3ea11e4ee0a610b294496301a051893e (diff) | |
parent | fa6d5ab67444013f9db696cca2257c871e002594 (diff) |
Merge #19283: refactor: Remove unused BlockAssembler::pblock member var
fa6d5ab67444013f9db696cca2257c871e002594 refactor: Remove unused BlockAssembler::pblock member var (MarcoFalke)
Pull request description:
It seems odd to have a confusing and fragile "convenience pointer" member variable to be able to write `pblock->vtx` instead of `pblocktemplate->block.vtx` in a single place.
ACKs for top commit:
promag:
Code review ACK fa6d5ab67444013f9db696cca2257c871e002594.
Tree-SHA512: e9f032b5ab702dbefffd370db3768ebfb95c13acc732972b695281ea34c91d70cd0a1700bc2c6f106dbc9de68e81bc6bb06c68c2afd53c17cba8ebee4f9931b9
-rw-r--r-- | src/miner.cpp | 4 | ||||
-rw-r--r-- | src/miner.h | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/miner.cpp b/src/miner.cpp index d9dcbe8a70..41a835f70a 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -109,7 +109,7 @@ std::unique_ptr<CBlockTemplate> 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(); @@ -226,7 +226,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->vTxSigOpsCost.push_back(iter->GetSigOpCost()); nBlockWeight += iter->GetTxWeight(); diff --git a/src/miner.h b/src/miner.h index 69296f9078..096585dfe4 100644 --- a/src/miner.h +++ b/src/miner.h @@ -128,8 +128,6 @@ class BlockAssembler private: // The constructed block template std::unique_ptr<CBlockTemplate> pblocktemplate; - // A convenience pointer that always refers to the CBlock in pblocktemplate - CBlock* pblock; // Configuration parameters for the block size bool fIncludeWitness; |