From ea9d92d453458218b049262da91b466c9afb259f Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Wed, 26 Sep 2018 10:15:31 -0400 Subject: [PATCH] only try to set best chain if signal is registered --- src/validation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index d7537f1fe4..9f60618b97 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3036,7 +3036,9 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode, int n } if (fDoFullFlush || ((mode == FLUSH_STATE_ALWAYS || mode == FLUSH_STATE_PERIODIC) && nNow > nLastSetChain + (int64_t)DATABASE_WRITE_INTERVAL * 1000000)) { // Update best block in wallet (so we can detect restored wallets). - GetMainSignals().SetBestChain(chainActive.GetLocator()); + if (!GetMainSignals().SetBestChain.empty()) { + GetMainSignals().SetBestChain(chainActive.GetLocator()); + } nLastSetChain = nNow; } } catch (const std::runtime_error& e) {