mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Add helper to wait for validation interface queue to catch up
This commit is contained in:
@@ -2572,11 +2572,7 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams&
|
||||
// Block until the validation queue drains. This should largely
|
||||
// never happen in normal operation, however may happen during
|
||||
// reindex, causing memory blowup if we run too far ahead.
|
||||
std::promise<void> promise;
|
||||
CallFunctionInValidationInterfaceQueue([&promise] {
|
||||
promise.set_value();
|
||||
});
|
||||
promise.get_future().wait();
|
||||
SyncWithValidationInterfaceQueue();
|
||||
}
|
||||
|
||||
if (ShutdownRequested())
|
||||
|
||||
Reference in New Issue
Block a user