mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
assumeutxo: Check snapshot base block is not marked invalid
Co-authored-by: Alfonso Roman Zubeldia <alfonsoromanz24@gmail.com>
This commit is contained in:
parent
80315c0118
commit
19ce3d407e
2 changed files with 19 additions and 0 deletions
|
|
@ -5677,6 +5677,11 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
|
|||
base_blockhash.ToString())};
|
||||
}
|
||||
|
||||
bool start_block_invalid = snapshot_start_block->nStatus & BLOCK_FAILED_MASK;
|
||||
if (start_block_invalid) {
|
||||
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) {
|
||||
return util::Error{_("Can't activate a snapshot when mempool not empty.")};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue