mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 19:37:27 -03:00
refuse to activate a UTXO snapshot if mempool not empty
This ensures that we avoid any unexpected conditions inherent in transferring non-empty mempools across chainstates. Note that this should never happen in practice given that snapshot activation will not occur outside of IBD, based upon the height checks in `loadtxoutset`.
This commit is contained in:
parent
ce585a9a15
commit
bb05857794
1 changed files with 8 additions and 0 deletions
|
@ -5185,6 +5185,14 @@ bool ChainstateManager::ActivateSnapshot(
|
|||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
if (Assert(m_active_chainstate->GetMempool())->size() > 0) {
|
||||
LogPrintf("[snapshot] can't activate a snapshot when mempool not empty\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t current_coinsdb_cache_size{0};
|
||||
int64_t current_coinstip_cache_size{0};
|
||||
|
||||
|
|
Loading…
Reference in a new issue