Skip to content

Commit ea9d92d

Browse files
committed
only try to set best chain if signal is registered
1 parent 61c5491 commit ea9d92d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/validation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3036,7 +3036,9 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode, int n
30363036
}
30373037
if (fDoFullFlush || ((mode == FLUSH_STATE_ALWAYS || mode == FLUSH_STATE_PERIODIC) && nNow > nLastSetChain + (int64_t)DATABASE_WRITE_INTERVAL * 1000000)) {
30383038
// Update best block in wallet (so we can detect restored wallets).
3039-
GetMainSignals().SetBestChain(chainActive.GetLocator());
3039+
if (!GetMainSignals().SetBestChain.empty()) {
3040+
GetMainSignals().SetBestChain(chainActive.GetLocator());
3041+
}
30403042
nLastSetChain = nNow;
30413043
}
30423044
} catch (const std::runtime_error& e) {

0 commit comments

Comments
 (0)