mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Fix ChainstateManager::AddChainstate() assertion crash
Check mempool exists before accessing size when prev_chainstate doesn't have initialized mempool.
This commit is contained in:
@@ -6248,7 +6248,7 @@ Chainstate& ChainstateManager::AddChainstate(std::unique_ptr<Chainstate> chainst
|
||||
|
||||
// Transfer possession of the mempool to the chainstate.
|
||||
// Mempool is empty at this point because we're still in IBD.
|
||||
assert(prev_chainstate.m_mempool->size() == 0);
|
||||
assert(!prev_chainstate.m_mempool || prev_chainstate.m_mempool->size() == 0);
|
||||
assert(!curr_chainstate.m_mempool);
|
||||
std::swap(curr_chainstate.m_mempool, prev_chainstate.m_mempool);
|
||||
return curr_chainstate;
|
||||
|
||||
Reference in New Issue
Block a user