txpool: Make nTransactionsUpdated atomic

This commit is contained in:
MarcoFalke
2019-05-23 19:17:09 +02:00
parent d0f81a96d9
commit fa0c9dbf91
3 changed files with 8 additions and 8 deletions

View File

@@ -480,6 +480,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
if (g_best_block_cv.wait_until(lock, checktxtime) == std::cv_status::timeout)
{
// Timeout: Check transactions for update
// without holding ::mempool.cs to avoid deadlocks
if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLastLP)
break;
checktxtime += std::chrono::seconds(10);