mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-02 11:41:18 +00:00
Merge bitcoin/bitcoin#30388: validation: Check if mempool exists before size check in ActivateSnapshot
33c48c106cf03ff62994ff5777a775982d90eab9 validation: Check if mempool exists before asserting in ActivateSnapshot (TheCharlatan)
Pull request description:
The mempool is an optional component of the chainstate manager, so don't assume its presence and instead check if it is there first.
ACKs for top commit:
maflcko:
re-ACK 33c48c106cf03ff62994ff5777a775982d90eab9
fjahr:
ACK 33c48c106cf03ff62994ff5777a775982d90eab9
Tree-SHA512: 7a3568d5b7af45efa7bf54bae7bac1f00dc99bc9d47a744d73594f283c952be9500168f680d72f4aee09761da4e878ddca83ba675cdea8ee9e44eeff00ac09da
This commit is contained in:
commit
aa61d4feb0
@ -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.")};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user