Make fReindex atomic to avoid race

This commit is contained in:
MeshCollider 2017-08-24 13:45:26 +12:00 committed by gladcow
parent cb8de0395f
commit e4b66f565a
2 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ CConditionVariable cvBlockChange;
int nScriptCheckThreads = 0;
bool fExperimentalMode = false;
bool fImporting = false;
bool fReindex = false;
std::atomic_bool fReindex(false);
bool fTxIndex = false;
bool fInsightExplorer = false; // insightexplorer
bool fAddressIndex = false; // insightexplorer
@ -4455,7 +4455,7 @@ bool static LoadBlockIndexDB()
// 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);

View File

@ -139,7 +139,7 @@ extern CWaitableCriticalSection csBestBlock;
extern CConditionVariable cvBlockChange;
extern bool fExperimentalMode;
extern bool fImporting;
extern bool fReindex;
extern std::atomic_bool fReindex;
extern int nScriptCheckThreads;
extern bool fTxIndex;