Skip to content

Commit aa61d4f

Browse files
committed
Merge bitcoin/bitcoin#30388: validation: Check if mempool exists before size check in ActivateSnapshot
33c48c1 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 33c48c1 fjahr: ACK 33c48c1 Tree-SHA512: 7a3568d5b7af45efa7bf54bae7bac1f00dc99bc9d47a744d73594f283c952be9500168f680d72f4aee09761da4e878ddca83ba675cdea8ee9e44eeff00ac09da
2 parents 5c0cd20 + 33c48c1 commit aa61d4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/validation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5681,7 +5681,8 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
56815681
return util::Error{strprintf(_("The base block header (%s) is part of an invalid chain."), base_blockhash.ToString())};
56825682
}
56835683

5684-
if (Assert(m_active_chainstate->GetMempool())->size() > 0) {
5684+
auto mempool{m_active_chainstate->GetMempool()};
5685+
if (mempool && mempool->size() > 0) {
56855686
return util::Error{_("Can't activate a snapshot when mempool not empty.")};
56865687
}
56875688
}

0 commit comments

Comments
 (0)