Eliminate data races for strMiscWarning and fLargeWork*Found.

This moves all access to these datastructures through accessor functions
 and protects them with a lock.
This commit is contained in:
Gregory Maxwell
2016-11-29 09:46:19 +00:00
parent c63198f1c7
commit e3ba0ef956
4 changed files with 53 additions and 16 deletions

View File

@@ -48,9 +48,6 @@ extern bool fPrintToConsole;
extern bool fPrintToDebugLog;
static const bool DEFAULT_TESTSAFEMODE = false;
extern std::string strMiscWarning;
extern bool fLargeWorkForkFound;
extern bool fLargeWorkInvalidChainFound;
extern bool fLogTimestamps;
extern bool fLogTimeMicros;
@@ -229,6 +226,11 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
std::string CopyrightHolders(const std::string& strPrefix);
void SetMiscWarning(const std::string& strWarning);
void SetfLargeWorkForkFound(bool flag);
bool GetfLargeWorkForkFound();
void SetfLargeWorkInvalidChainFound(bool flag);
bool GetfLargeWorkInvalidChainFound();
std::string GetWarnings(const std::string& strFor);
#endif // BITCOIN_UTIL_H