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