diff options
author | Matt Corallo <git@bluematt.me> | 2016-12-04 00:17:30 -0800 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2016-12-04 00:17:30 -0800 |
commit | 2d6e5619afa2d43a37a0a38daf33f58965ddfa80 (patch) | |
tree | 9bdc85dfd1048bc7d7f2d535d9f63b3b373ef4d9 /src/test/miner_tests.cpp | |
parent | 2736c44c8edea5ce6a502a04269926fecda27301 (diff) |
Switch pblock in ProcessNewBlock to a shared_ptr
This (finally) fixes a performance regression in
b3b3c2a5623d5c942d2b3565cc2d833c65105555
Diffstat (limited to 'src/test/miner_tests.cpp')
-rw-r--r-- | src/test/miner_tests.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index ca703841db..bc1bdd8874 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -223,7 +223,8 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) txFirst.push_back(pblock->vtx[0]); pblock->hashMerkleRoot = BlockMerkleRoot(*pblock); pblock->nNonce = blockinfo[i].nonce; - BOOST_CHECK(ProcessNewBlock(chainparams, pblock, true, NULL, NULL)); + std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock); + BOOST_CHECK(ProcessNewBlock(chainparams, shared_pblock, true, NULL, NULL)); pblock->hashPrevBlock = pblock->GetHash(); } |