HomePhabricator

bugfix: correct is_snapshot_cs in VerifyDB

Description

bugfix: correct is_snapshot_cs in VerifyDB

Summary:
Chainstate.m_from_snapshot_blockhash is the blockhash which is the base of the snapshot this chainstate was created from, or std::nullopt if this chain is not created from a snapshot. So the logic was trivially backwards, is_snapshot_cs should be true if m_from_snapshot_blockhash is set.

The bug is not currently active, as it would affect a node that loaded an assumeutxo snapshot (which is not yet possible)
Better to backport this fix early before the issue becomes apparent

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

Test Plan:
check that this does not break any existing test

ninja all check-all

Reviewers: #bitcoin_abc, roqqit

Reviewed By: #bitcoin_abc, roqqit

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

Details

Provenance
James O'Beirne <james.obeirne@pm.me>Authored on May 25 2023, 01:10
PiRKCommitted on Tue, Feb 4, 07:04
PiRKPushed on Tue, Feb 4, 07:05
Reviewer
Restricted Project
Differential Revision
D17629: bugfix: correct is_snapshot_cs in VerifyDB
Parents
rABC12cff4fe1b5c: [ecash-lib] Better behavior of withPrefix() method in Address class
Branches
Unknown
Tags
Unknown