Make fReindex atomic to avoid race
This commit is contained in:
parent
cb8de0395f
commit
e4b66f565a
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue