mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
assumeutxo, blockstorage: prevent core dump on invalid hash
This commit is contained in:
parent
d53400e75e
commit
4a5be10b92
1 changed files with 6 additions and 1 deletions
|
@ -387,7 +387,12 @@ bool BlockManager::LoadBlockIndex(const std::optional<uint256>& snapshot_blockha
|
||||||
}
|
}
|
||||||
|
|
||||||
if (snapshot_blockhash) {
|
if (snapshot_blockhash) {
|
||||||
const AssumeutxoData au_data = *Assert(GetParams().AssumeutxoForBlockhash(*snapshot_blockhash));
|
const std::optional<AssumeutxoData> maybe_au_data = GetParams().AssumeutxoForBlockhash(*snapshot_blockhash);
|
||||||
|
if (!maybe_au_data) {
|
||||||
|
m_opts.notifications.fatalError(strprintf("Assumeutxo data not found for the given blockhash '%s'.", snapshot_blockhash->ToString()));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const AssumeutxoData& au_data = *Assert(maybe_au_data);
|
||||||
m_snapshot_height = au_data.height;
|
m_snapshot_height = au_data.height;
|
||||||
CBlockIndex* base{LookupBlockIndex(*snapshot_blockhash)};
|
CBlockIndex* base{LookupBlockIndex(*snapshot_blockhash)};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue