Switch pblock in ProcessNewBlock to a shared_ptr

This (finally) fixes a performance regression in
b3b3c2a562
This commit is contained in:
Matt Corallo
2016-12-04 00:17:30 -08:00
parent 2736c44c8e
commit 2d6e5619af
6 changed files with 20 additions and 21 deletions

View File

@@ -127,7 +127,8 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;
ProcessNewBlock(chainparams, &block, true, NULL, NULL);
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);
ProcessNewBlock(chainparams, shared_pblock, true, NULL, NULL);
CBlock result = block;
return result;