Merge d6069cb8d6 into merged_master (Bitcoin PR bitcoin/bitcoin#28233)

This commit is contained in:
ivanlele 2026-02-20 13:05:54 +00:00
commit fea80edd25
No known key found for this signature in database

View file

@ -3164,8 +3164,10 @@ bool Chainstate::FlushStateToDisk(
return FatalError(m_chainman.GetNotifications(), state, _("Disk space is too low!"));
}
// Flush the chainstate (which may refer to block index entries).
if (!CoinsTip().Flush())
const auto empty_cache{(mode == FlushStateMode::ALWAYS) || fCacheLarge || fCacheCritical || fFlushForPrune};
if (empty_cache ? !CoinsTip().Flush() : !CoinsTip().Sync()) {
return FatalError(m_chainman.GetNotifications(), state, _("Failed to write to coin database."));
}
m_last_flush = nNow;
full_flush_completed = true;
TRACE5(utxocache, flush,