Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 580 Lines • ▼ Show 20 Lines | if (!lpval.isNull()) { | ||||
nTransactionsUpdatedLastLP = atoi64(lpstr.substr(64)); | nTransactionsUpdatedLastLP = atoi64(lpstr.substr(64)); | ||||
} else { | } else { | ||||
// NOTE: Spec does not specify behaviour for non-string longpollid, | // NOTE: Spec does not specify behaviour for non-string longpollid, | ||||
// but this makes testing easier | // but this makes testing easier | ||||
hashWatchedChain = ::ChainActive().Tip()->GetBlockHash(); | hashWatchedChain = ::ChainActive().Tip()->GetBlockHash(); | ||||
nTransactionsUpdatedLastLP = nTransactionsUpdatedLast; | nTransactionsUpdatedLastLP = nTransactionsUpdatedLast; | ||||
} | } | ||||
// Release the wallet and main lock while waiting | // Release 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); | ||||
WAIT_LOCK(g_best_block_mutex, lock); | WAIT_LOCK(g_best_block_mutex, lock); | ||||
while (g_best_block == hashWatchedChain && IsRPCRunning()) { | while (g_best_block == hashWatchedChain && IsRPCRunning()) { | ||||
if (g_best_block_cv.wait_until(lock, checktxtime) == | if (g_best_block_cv.wait_until(lock, checktxtime) == | ||||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |