validation: do not wipe utxo cache for stats/scans/snapshots

Since #28280, the cost of a non-wiping sync of the UTXO cache is only proportional to the number of dirty entries, rather than proportional to the size of the entire cache. Because of that, there is no reason to perform a wiping flush in case the contents of the cache is still useful.

Split the FlushStateMode::ALWAYS mode into a FORCE_SYNC (non-wiping) and a FORCE_FLUSH (wiping), and then use the former in scantxoutset, gettxoutsetinfo, snapshot creation.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
Co-authored-by: cedwies <141683552+cedwies@users.noreply.github.com>
This commit is contained in:
authored and Lőrinc committed 2026-01-03 12:43:57 +01:00
1 parent 7099e93d0a
commit c6ca2b85a3
8 files changed
+20 -17

No files matched your search

+1
View File
@@ -46,6 +46,7 @@ FLUSH_MODES = [
'IF_NEEDED',
'PERIODIC',
'FORCE_FLUSH',
'FORCE_SYNC',
]