diff options
author | MeshCollider <dobsonsa68@gmail.com> | 2017-08-24 13:45:26 +1200 |
---|---|---|
committer | MeshCollider <dobsonsa68@gmail.com> | 2017-09-07 12:00:30 +1200 |
commit | 35aeabec62cf10f3c0de297b1189f0a669b69d6e (patch) | |
tree | f30b94218efff39df31876f200f1e25d862eaf27 /src/validation.cpp | |
parent | 58d91af59e6417ad4dde0c5e1c9bfd18017d755d (diff) |
Make fReindex atomic to avoid race
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index d1a8b8460a..0d4fdf79ab 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -66,7 +66,7 @@ CWaitableCriticalSection csBestBlock; CConditionVariable cvBlockChange; int nScriptCheckThreads = 0; std::atomic_bool fImporting(false); -bool fReindex = false; +std::atomic_bool fReindex(false); bool fTxIndex = false; bool fHavePruned = false; bool fPruneMode = false; @@ -3523,7 +3523,7 @@ bool static LoadBlockIndexDB(const CChainParams& chainparams) // Check whether we need to continue reindexing bool fReindexing = false; pblocktree->ReadReindexing(fReindexing); - fReindex |= fReindexing; + if(fReindexing) fReindex = true; // Check whether we have a transaction index pblocktree->ReadFlag("txindex", fTxIndex); |