Page MenuHomePhabricator

bugfix: correct is_snapshot_cs in VerifyDB
Needs ReviewPublic

Authored by PiRK on Mon, Feb 3, 10:22.

Details

Reviewers
None
Group Reviewers
Restricted Project
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