|
|
@ -40,6 +40,7 @@ |
|
|
|
#include <validationinterface.h> |
|
|
|
#include <validationinterface.h> |
|
|
|
#include <warnings.h> |
|
|
|
#include <warnings.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <future> |
|
|
|
#include <sstream> |
|
|
|
#include <sstream> |
|
|
|
|
|
|
|
|
|
|
|
#include <boost/algorithm/string/replace.hpp> |
|
|
|
#include <boost/algorithm/string/replace.hpp> |
|
|
@ -2566,6 +2567,18 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& |
|
|
|
int nStopAtHeight = gArgs.GetArg("-stopatheight", DEFAULT_STOPATHEIGHT); |
|
|
|
int nStopAtHeight = gArgs.GetArg("-stopatheight", DEFAULT_STOPATHEIGHT); |
|
|
|
do { |
|
|
|
do { |
|
|
|
boost::this_thread::interruption_point(); |
|
|
|
boost::this_thread::interruption_point(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GetMainSignals().CallbacksPending() > 10) { |
|
|
|
|
|
|
|
// 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(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ShutdownRequested()) |
|
|
|
if (ShutdownRequested()) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|