aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2016-11-29 09:46:19 +0000
committerGregory Maxwell <greg@xiph.org>2016-12-03 07:17:34 +0000
commite3ba0ef95636290a3bb597ddd25d13ea13b034aa (patch)
tree41f2d20d968a2437bdde4ac3a3ded4700220fb4f /src/util.h
parentc63198f1c787d69052d6332c5e52118f58eacf56 (diff)
downloadbitcoin-e3ba0ef95636290a3bb597ddd25d13ea13b034aa.tar.xz
Eliminate data races for strMiscWarning and fLargeWork*Found.
This moves all access to these datastructures through accessor functions and protects them with a lock.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util.h b/src/util.h
index edc190e1e5..b34966fd80 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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