mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 14:18:58 +02:00
protect g_chainman with cs_main
I'd previously attempted to create a specialized lock for ChainstateManager, but it turns out that because that lock would be required for functions like ChainActive() and ChainstateActive(), it created irreconcilable lock inversions since those functions are used so broadly throughout the codebase. Instead, I'm just using cs_main to protect the contents of g_chainman. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
@@ -82,7 +82,7 @@ void AppTests::appTests()
|
||||
// Reset global state to avoid interfering with later tests.
|
||||
AbortShutdown();
|
||||
UnloadBlockIndex();
|
||||
g_chainman.Reset();
|
||||
WITH_LOCK(::cs_main, g_chainman.Reset());
|
||||
}
|
||||
|
||||
//! Entry point for BitcoinGUI tests.
|
||||
|
||||
Reference in New Issue
Block a user