aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/mining.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2021-04-05 11:11:22 -0400
committerCarl Dong <contact@carldong.me>2021-04-05 11:13:51 -0400
commitcced0f46c9133e0fc6211e987421ad1d9be1a399 (patch)
treea0538dc9d5ee76146a840570e61fdfc131b51044 /src/rpc/mining.cpp
parent66daf4cb3b47e8218623936d23ad504fd189e70b (diff)
miner: Pass in previous CBlockIndex to RegenerateCommitments
Diffstat (limited to 'src/rpc/mining.cpp')
-rw-r--r--src/rpc/mining.cpp3
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);