HomePhabricator

init: abort loading of blockindex in case of missing height.

Description

init: abort loading of blockindex in case of missing height.

Summary:
If a height is missing we are facing a non-contiguous block index db, and could previously
hit an assert in GetAncestor() called from BuildSkip() instead of returning an error.

And perturb file in the functional test to ensure failure instead of only deleting them

This is a backport of core#26653, core#27823, core#28612 and core#28831

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18622

Details

Provenance
brunoerg <brunoely.gc@gmail.com>Authored on Dec 7 2022, 16:50
PiRKCommitted on Sep 16 2025, 06:22
PiRKPushed on Sep 16 2025, 06:22
Reviewer
Restricted Project
Differential Revision
D18622: init: abort loading of blockindex in case of missing height.
Parents
rABC5ce650ca3304: validation: don't erase coins cache on prune flushes
Branches
Unknown
Tags
Unknown