mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-19 12:10:19 +01:00
validation: Check if mempool exists before asserting in ActivateSnapshot
This commit is contained in:
@@ -5681,7 +5681,8 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
|
||||
return util::Error{strprintf(_("The base block header (%s) is part of an invalid chain."), base_blockhash.ToString())};
|
||||
}
|
||||
|
||||
if (Assert(m_active_chainstate->GetMempool())->size() > 0) {
|
||||
auto mempool{m_active_chainstate->GetMempool()};
|
||||
if (mempool && mempool->size() > 0) {
|
||||
return util::Error{_("Can't activate a snapshot when mempool not empty.")};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user