mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
validation: Check if mempool exists before asserting in ActivateSnapshot
This commit is contained in:
parent
3714692644
commit
33c48c106c
1 changed files with 2 additions and 1 deletions
|
@ -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())};
|
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.")};
|
return util::Error{_("Can't activate a snapshot when mempool not empty.")};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue