Update the wallet best block marker when pruning

Github-Pull: #7502
Rebased-From: e4eebb604e
This commit is contained in:
Pieter Wuille 2016-02-10 15:47:06 +01:00 committed by Wladimir J. van der Laan
parent 00ec73e062
commit 1329963001
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -2266,7 +2266,7 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
return AbortNode(state, "Failed to write to coin database");
nLastFlush = nNow;
}
if ((mode == FLUSH_STATE_ALWAYS || mode == FLUSH_STATE_PERIODIC) && nNow > nLastSetChain + (int64_t)DATABASE_WRITE_INTERVAL * 1000000) {
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());
nLastSetChain = nNow;