HomePhabricator

node: Extract chainstate loading sequence

Description

node: Extract chainstate loading sequence

Summary:

This commit is intended to be as close to a move-only commit as
possible, and lingering ugliness will be resolved in subsequent
commits.

A few variables that are passed in by value instead of by reference
deserve explanation:
- fReset and fReindexChainstate are both local variables in AppInitMain
  and are not modified in the sequence
- fPruneMode, despite being a global, is only modified in
  AppInitParameterInteraction, long before LoadChainstate is called

Partial backport of core#23280:
https://github.com/bitcoin/bitcoin/pull/23280/commits/cb64af9635a9553e335f2dc0b1cca20c6bbd0933

Depends on D12554.

Note: fPruneMode has been renamed in chainstate.cpp to prevent shadowing
the global variable.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Sep 20 2021, 20:12
FabienCommitted on Nov 21 2022, 19:26
FabienPushed on Nov 21 2022, 19:26
Reviewer
Restricted Project
Differential Revision
D12555: node: Extract chainstate loading sequence
Parents
rABC8406fa2d0d0a: Remove GetAdjustedTime from init.cpp
Branches
Unknown
Tags
Unknown