diff options
author | Carl Dong <contact@carldong.me> | 2021-04-05 11:11:22 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-04-05 11:13:51 -0400 |
commit | cced0f46c9133e0fc6211e987421ad1d9be1a399 (patch) | |
tree | a0538dc9d5ee76146a840570e61fdfc131b51044 /src/test/util | |
parent | 66daf4cb3b47e8218623936d23ad504fd189e70b (diff) | |
download | bitcoin-cced0f46c9133e0fc6211e987421ad1d9be1a399.tar.xz |
miner: Pass in previous CBlockIndex to RegenerateCommitments
Diffstat (limited to 'src/test/util')
-rw-r--r-- | src/test/util/setup_common.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index f7800aefca..46c7b781b0 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -253,7 +253,8 @@ CBlock TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransa for (const CMutableTransaction& tx : txns) { block.vtx.push_back(MakeTransactionRef(tx)); } - RegenerateCommitments(block, WITH_LOCK(::cs_main, return std::ref(g_chainman.m_blockman))); + CBlockIndex* prev_block = WITH_LOCK(::cs_main, return g_chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock)); + RegenerateCommitments(block, prev_block); while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce; |