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:
1 parent
2b081c4568
commit
c9017ce3bc
5 files changed
+48
-11
No files matched your search
@@ -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