Page MenuHomePhabricator

node: Extract chainstate loading sequence
ClosedPublic

Authored by Fabien on Nov 21 2022, 14:31.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCaf94e5247215: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable