This PR paves the way for de-globalizing g_chainman entirely by removing the usage of g_chainman in the following functions/methods:
~CMainCleanupCChainState::FlushStateToDiskUnloadBlockIndex
The remaining direct uses of g_chainman are as follows:
- In initialization codepaths:
AppTestsAppInitMainTestingSetup::TestingSetup
::ChainstateActiveLookupBlockIndex- Note:
LookupBlockIndexis used extensively throughout the codebase and require a much larger set of changes, therefore I’ve left it out of this initial PR
- Note: