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/rpc/mining.cpp | |
parent | 66daf4cb3b47e8218623936d23ad504fd189e70b (diff) |
miner: Pass in previous CBlockIndex to RegenerateCommitments
Diffstat (limited to 'src/rpc/mining.cpp')
-rw-r--r-- | src/rpc/mining.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 72ad0df199..2eddc731c3 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -369,7 +369,8 @@ static RPCHelpMan generateblock() // Add transactions block.vtx.insert(block.vtx.end(), txs.begin(), txs.end()); - 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); { LOCK(cs_main); |