diff options
| author | James O'Beirne <[email protected]> | 2020-01-29 09:57:56 -0500 |
|---|---|---|
| committer | James O'Beirne <[email protected]> | 2020-03-17 14:07:58 -0400 |
| commit | c9017ce3bc27665594c9d80f395780d40755bb22 (patch) | |
| tree | 36ea710a14db1757ed270ff6e8585eb53427e74f /src/qt/test | |
| parent | test: add basic tests for ChainstateManager (diff) | |
| download | discoin-c9017ce3bc27665594c9d80f395780d40755bb22.tar.xz discoin-c9017ce3bc27665594c9d80f395780d40755bb22.zip | |
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 <[email protected]>
Diffstat (limited to 'src/qt/test')
| -rw-r--r-- | src/qt/test/apptests.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp index f9eb4cde3..064b9ceb1 100644 --- a/src/qt/test/apptests.cpp +++ b/src/qt/test/apptests.cpp @@ -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. |