HomePhabricator

assumeutxo cleanup: Move IsInitialBlockDownload & NotifyHeaderTip to…

Description

assumeutxo cleanup: Move IsInitialBlockDownload & NotifyHeaderTip to ChainstateManager

Summary:
This change makes IsInitialBlockDownload and NotifyHeaderTip functions no
longer tied to individual Chainstate objects. It makes them work with the
ChainstateManager object instead so code is simpler and it is no longer
possible to call them incorrectly with an inactive Chainstate.

This change also makes m_cached_finished_ibd caching easier to reason about,
because now there is only one cached value instead of two (for background and
snapshot chainstates) so the cached IBD state now no longer gets reset when a
snapshot is loaded.

There should be no change in behavior because these functions were always
called on the active ChainState objects.

These changes were discussed previously
https://github.com/bitcoin/bitcoin/pull/27746#discussion_r1246868905 and
https://github.com/bitcoin/bitcoin/pull/27746#discussion_r1237552792 as
possible followups for that PR.

This is a backport of core#28218

Depends on D17605

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Aug 4 2023, 20:43
PiRKCommitted on Tue, Feb 11, 08:31
PiRKPushed on Tue, Feb 11, 08:31
Reviewer
Restricted Project
Differential Revision
D17635: assumeutxo cleanup: Move IsInitialBlockDownload & NotifyHeaderTip to ChainstateManager
Parents
rABC1b64fae67afe: [electrum] fix output parsing when pay-to field is empty
Branches
Unknown
Tags
Unknown