validation: Check if mempool exists before asserting in ActivateSnapshot

This commit is contained in:
TheCharlatan committed 2024-07-04 09:57:56 +02:00
1 parent 3714692644
commit 33c48c106c
1 file changed
+2 -1
+2 -1
View File
@@ -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.")};
}
}