mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Fix csBestBlock/cvBlockChange waiting in rpc/mining
This commit is contained in:
parent
ad960f5771
commit
45dd135039
3 changed files with 8 additions and 2 deletions
|
|
@ -204,6 +204,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);
|
||||
|
|
@ -2195,7 +2196,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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue