HomePhabricator

validation: add CChainState::m_disabled and ChainMan::isUsable

Description

validation: add CChainState::m_disabled and ChainMan::isUsable

Summary:
and remove m_snapshot_validated. This state can now be inferred by the
number of isUsable chainstates.

m_disabled is used to signal that a chainstate should no longer be used
by validation logic; it is used as a sentinel when background validation
completes or if the snapshot chainstate is found to be invalid.

isUsable is a convenience method that incorporates m_disabled.

This is a partial backport of core#25740
https://github.com/bitcoin/bitcoin/pull/25740/commits/c29f26b47b8ef978d8689dc0222aa663361ee6cb

Depends on D14673

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
James O'Beirne <james.obeirne@pm.me>Authored on Feb 2 2022, 19:40
PiRKCommitted on Oct 26 2023, 11:39
PiRKPushed on Oct 26 2023, 11:39
Reviewer
Restricted Project
Differential Revision
D14685: validation: add CChainState::m_disabled and ChainMan::isUsable
Parents
rABCf6f26b33d3e3: coinstats: Separate hasher/index lookup codepaths
Branches
Unknown
Tags
Unknown