mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
only try to set best chain if signal is registered
This commit is contained in:
parent
61c54913c9
commit
ea9d92d453
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue