HomePhabricator

Reject headers building on invalid chains by tracking invalidity

Description

Reject headers building on invalid chains by tracking invalidity

Summary:
This tracks the set of all known invalid-themselves blocks (ie
blocks which we attempted to connect but which were found to be
invalid). This is used to cheaply check if new headers build on an
invalid chain.

While we're at it we also resolve an edge-case in invalidateblock
on pruned nodes which results in them needing a reindex if they
fail to reorg.

Partial backport of Core PR11531 (commit 015a525)
https://github.com/bitcoin/bitcoin/pull/11531/commits/015a5258adffb0cf394f387a95ac9c8afc34cfc3
Progress towards T456

Test Plan:
make check
test_runner.py --extended

Reviewers: deadalnix, Fabien, #bitcoin_abc

Reviewed By: deadalnix, Fabien, #bitcoin_abc

Subscribers: teamcity, schancel

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

Details

Provenance
Matt Corallo <git@bluematt.me>Authored on May 3 2019, 18:17
jasonbcoxCommitted on Jun 26 2019, 15:59
FabienPushed on Jun 26 2019, 17:00
Reviewer
Restricted Project
Differential Revision
D2645: Reject headers building on invalid chains by tracking invalidity
Parents
rSTAGING27b6f17553c0: wallet: shuffle coins before grouping, where warranted
Branches
Unknown
Tags
Unknown