HomePhabricator

Only load BlockMan in BlockMan member functions

Description

Only load BlockMan in BlockMan member functions

Summary:
This commit effectively splits the "load block index itself" logic from
"derive Chainstate variables from loaded block index" logic.

This means that BlockManager::LoadBlockIndex{,DB} will only load what's
relevant to the BlockManager.

I strongly recommend reviewing with the following git-diff flags:

--color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change

This is a partial backport of core#24515
https://github.com/bitcoin/bitcoin/pull/24515/commits/c600ee38168a460d3026eae0e289c976194aad14

Depends on D13021

The sorting code is deduplicated in D13023

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Jan 23 2023, 09:41
PiRKCommitted on Jan 23 2023, 15:48
PiRKPushed on Jan 23 2023, 15:48
Reviewer
Restricted Project
Differential Revision
D13022: Only load BlockMan in BlockMan member functions
Parents
rABCcecbcba200c8: style-only: No need for std::pair for vSortedByHeight
Branches
Unknown
Tags
Unknown