diff options
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 2c5b5a1a31..7795905c48 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -210,6 +210,7 @@ CChain& chainActive = g_chainstate.chainActive; CBlockIndex *pindexBestHeader = nullptr; CWaitableCriticalSection csBestBlock; CConditionVariable cvBlockChange; +uint256 hashBestBlock; int nScriptCheckThreads = 0; std::atomic_bool fImporting(false); std::atomic_bool fReindex(false); @@ -2151,7 +2152,11 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar // New best block mempool.AddTransactionsUpdated(1); - cvBlockChange.notify_all(); + { + WaitableLock lock(csBestBlock); + hashBestBlock = pindexNew->GetBlockHash(); + cvBlockChange.notify_all(); + } std::vector<std::string> warningMessages; if (!IsInitialBlockDownload()) |