Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 540 Lines • ▼ Show 20 Lines | if (!lpval.isNull()) { | ||||
} | } | ||||
// Release the wallet and main lock while waiting | // Release the wallet and main lock while waiting | ||||
LEAVE_CRITICAL_SECTION(cs_main); | LEAVE_CRITICAL_SECTION(cs_main); | ||||
{ | { | ||||
checktxtime = | checktxtime = | ||||
std::chrono::steady_clock::now() + std::chrono::minutes(1); | std::chrono::steady_clock::now() + std::chrono::minutes(1); | ||||
WaitableLock lock(csBestBlock); | WaitableLock lock(g_best_block_mutex); | ||||
while (chainActive.Tip()->GetBlockHash() == hashWatchedChain && | while (g_best_block == hashWatchedChain && IsRPCRunning()) { | ||||
IsRPCRunning()) { | if (g_best_block_cv.wait_until(lock, checktxtime) == | ||||
if (cvBlockChange.wait_until(lock, checktxtime) == | |||||
std::cv_status::timeout) { | std::cv_status::timeout) { | ||||
// Timeout: Check transactions for update | // Timeout: Check transactions for update | ||||
if (mempool.GetTransactionsUpdated() != | if (mempool.GetTransactionsUpdated() != | ||||
nTransactionsUpdatedLastLP) { | nTransactionsUpdatedLastLP) { | ||||
break; | break; | ||||
} | } | ||||
checktxtime += std::chrono::seconds(10); | checktxtime += std::chrono::seconds(10); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |