HomePhabricator

Move block-arrival information / preciousblock counters to ChainstateManager

Description

Move block-arrival information / preciousblock counters to ChainstateManager

Summary:
Block arrival information (and the preciousblock RPC, a related concept) are
both chainstate-agnostic, so these are moved to ChainstateManager. This should
just be a refactor, without any observable behavior changes.

This is a partial backport of core#27746
https://github.com/bitcoin/bitcoin/pull/27746/commits/471da5f6e74bac71aeffe2ebc5faff145a6cbcea

Depends on D17432

Note that nBlockSequenceId is atomic since D1958 (so we bypassed core#22824), and cs_main is not really needed when resetting it. But better to keep the lock in case future backports add more code to ResetBlockSequenceCounters (this is called only in tests)

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Suhas Daftuar <sdaftuar@chaincode.com>Authored on Jun 6 2023, 11:50
PiRKCommitted on Fri, Jan 17, 08:07
PiRKPushed on Fri, Jan 17, 08:07
Reviewer
Restricted Project
Differential Revision
D17433: Move block-arrival information / preciousblock counters to ChainstateManager
Parents
rABCcfc92ee56946: Explicitly track maximum block height stored in undo files
Branches
Unknown
Tags
Unknown