Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 2,856 Lines • ▼ Show 20 Lines | bool ActivateBestChain(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindexNewTip = nullptr; | CBlockIndex *pindexNewTip = nullptr; | ||||
do { | do { | ||||
boost::this_thread::interruption_point(); | boost::this_thread::interruption_point(); | ||||
if (GetMainSignals().CallbacksPending() > 10) { | if (GetMainSignals().CallbacksPending() > 10) { | ||||
// Block until the validation queue drains. This should largely | // Block until the validation queue drains. This should largely | ||||
// never happen in normal operation, however may happen during | // never happen in normal operation, however may happen during | ||||
// reindex, causing memory blowup if we run too far ahead. | // reindex, causing memory blowup if we run too far ahead. | ||||
std::promise<void> promise; | SyncWithValidationInterfaceQueue(); | ||||
CallFunctionInValidationInterfaceQueue( | |||||
[&promise] { promise.set_value(); }); | |||||
promise.get_future().wait(); | |||||
} | } | ||||
if (ShutdownRequested()) { | if (ShutdownRequested()) { | ||||
break; | break; | ||||
} | } | ||||
const CBlockIndex *pindexFork; | const CBlockIndex *pindexFork; | ||||
bool fInitialDownload; | bool fInitialDownload; | ||||
▲ Show 20 Lines • Show All 2,721 Lines • Show Last 20 Lines |