mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
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
This commit is contained in:
parent
959a031bf8
commit
d4d94dfb15
@ -118,7 +118,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
|
|||||||
|
|
||||||
if(!pblocktemplate.get())
|
if(!pblocktemplate.get())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
pblock = &pblocktemplate->block; // pointer for convenience
|
CBlock* const pblock = &pblocktemplate->block; // pointer for convenience
|
||||||
|
|
||||||
// Add dummy coinbase tx as first transaction
|
// Add dummy coinbase tx as first transaction
|
||||||
pblock->vtx.emplace_back();
|
pblock->vtx.emplace_back();
|
||||||
@ -281,7 +281,7 @@ bool BlockAssembler::TestPackageTransactions(const CTxMemPool::setEntries& packa
|
|||||||
|
|
||||||
void BlockAssembler::AddToBlock(CTxMemPool::txiter iter)
|
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->vTxFees.push_back(iter->GetFee());
|
||||||
pblocktemplate->vTxSigOps.push_back(iter->GetSigOpCount());
|
pblocktemplate->vTxSigOps.push_back(iter->GetSigOpCount());
|
||||||
nBlockSize += iter->GetTxSize();
|
nBlockSize += iter->GetTxSize();
|
||||||
|
@ -129,8 +129,6 @@ class BlockAssembler
|
|||||||
private:
|
private:
|
||||||
// The constructed block template
|
// The constructed block template
|
||||||
std::unique_ptr<CBlockTemplate> pblocktemplate;
|
std::unique_ptr<CBlockTemplate> pblocktemplate;
|
||||||
// A convenience pointer that always refers to the CBlock in pblocktemplate
|
|
||||||
CBlock* pblock;
|
|
||||||
|
|
||||||
// Configuration parameters for the block size
|
// Configuration parameters for the block size
|
||||||
unsigned int nBlockMaxSize;
|
unsigned int nBlockMaxSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user