Fix csBestBlock/cvBlockChange waiting in rpc/mining

This commit is contained in:
Pieter Wuille
2018-03-20 21:04:27 -07:00
parent ad960f5771
commit 45dd135039
3 changed files with 8 additions and 2 deletions

View File

@@ -471,7 +471,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
checktxtime = std::chrono::steady_clock::now() + std::chrono::minutes(1);
WaitableLock lock(csBestBlock);
while (chainActive.Tip()->GetBlockHash() == hashWatchedChain && IsRPCRunning())
while (hashBestBlock == hashWatchedChain && IsRPCRunning())
{
if (cvBlockChange.wait_until(lock, checktxtime) == std::cv_status::timeout)
{