mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge #19927: validation: Reduce direct g_chainman usage
72a1d5c6f3validation: Remove review-only comments + assertions (Carl Dong)3756853b15docs: Move FindFilesToPrune{,Manual} doxygen comment (Carl Dong)485899a93cstyle: Make FindFilesToPrune{,Manual} match style guide (Carl Dong)3f5b5f3f6dvalidation: Move FindFilesToPrune{,Manual} to BlockManager (Carl Dong)f8d4975ab3validation: Move PruneOneBlockFile to BlockManager (Carl Dong)74f73c783dvalidation: Pass in chainman to UnloadBlockIndex (Carl Dong)4668ded6d6validation: Move ~CMainCleanup logic to ~BlockManager (Carl Dong) Pull request description: This PR paves the way for de-globalizing `g_chainman` entirely by removing the usage of `g_chainman` in the following functions/methods: - `~CMainCleanup` - `CChainState::FlushStateToDisk` - `UnloadBlockIndex` The remaining direct uses of `g_chainman` are as follows: 1. In initialization codepaths: - `AppTests` - `AppInitMain` - `TestingSetup::TestingSetup` 2. `::ChainstateActive` 3. `LookupBlockIndex` - Note: `LookupBlockIndex` is used extensively throughout the codebase and require a much larger set of changes, therefore I've left it out of this initial PR ACKs for top commit: MarcoFalke: re-ACK72a1d5c6f3👚 jnewbery: utACK72a1d5c6f3Tree-SHA512: 944a4fa8405eecf39706ff944375d6824373aaeea849d11473f08181eff26b12f70043a8348a5b08e6e9021b243b481842fbdfbc7c3140ca795fce3688b7f5c3
This commit is contained in:
@@ -1563,7 +1563,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
|
||||
chainman.m_total_coinstip_cache = nCoinCacheUsage;
|
||||
chainman.m_total_coinsdb_cache = nCoinDBCache;
|
||||
|
||||
UnloadBlockIndex(node.mempool.get());
|
||||
UnloadBlockIndex(node.mempool.get(), chainman);
|
||||
|
||||
// new CBlockTreeDB tries to delete the existing file, which
|
||||
// fails if it's still open from the previous loop. Close it first:
|
||||
|
||||
Reference in New Issue
Block a user