aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.cpp
diff options
context:
space:
mode:
authorMatt Corallo <[email protected]>2016-12-04 00:17:30 -0800
committerMatt Corallo <[email protected]>2016-12-04 00:17:30 -0800
commit2d6e5619afa2d43a37a0a38daf33f58965ddfa80 (patch)
tree9bdc85dfd1048bc7d7f2d535d9f63b3b373ef4d9 /src/test/test_bitcoin.cpp
parentMake the optional pblock in ActivateBestChain a shared_ptr (diff)
downloaddiscoin-2d6e5619afa2d43a37a0a38daf33f58965ddfa80.tar.xz
discoin-2d6e5619afa2d43a37a0a38daf33f58965ddfa80.zip
Switch pblock in ProcessNewBlock to a shared_ptr
This (finally) fixes a performance regression in b3b3c2a5623d5c942d2b3565cc2d833c65105555
Diffstat (limited to 'src/test/test_bitcoin.cpp')
-rw-r--r--src/test/test_bitcoin.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index f979d01a3..139389117 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -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;