From e6eac19062ebafaafdbf5b881f8195dfbc98d575 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 6 Feb 2017 17:38:57 -0500 Subject: [PATCH] Make nTimeBestReceived atomic zcash: cherry picked from commit d8f2b8a8c032b83a3bd90750e58abaeece7e34e7 zcash: https://github.com/bitcoin/bitcoin/pull/9708 --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 51b719128..ec52f1a6d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -65,7 +65,7 @@ CCriticalSection cs_main; BlockMap mapBlockIndex; CChain chainActive; CBlockIndex *pindexBestHeader = NULL; -static int64_t nTimeBestReceived = 0; +static std::atomic nTimeBestReceived(0); // Used only to inform the wallet of when we last received a block CWaitableCriticalSection csBestBlock; CConditionVariable cvBlockChange; int nScriptCheckThreads = 0;