mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
refactor: rename FlushStateMode::ALWAYS to FORCE_FLUSH
This prepares the addition of `FORCE_SYNC`. `empty_cache` in `FlushStateToDisk` was moved up to be reusable and `FlushStateMode::FORCE_FLUSH` was used as a placeholder before we properly split the two new states. `log_utxocache_flush.py` was regenerated and the alignment adjusted for the wider `FlushStateMode` values. Co-authored-by: Pieter Wuille <pieter@wuille.net> Co-authored-by: optout <13562139+optout21@users.noreply.github.com>
This commit is contained in:
@@ -109,7 +109,7 @@ FLUSHMODE_NAME = {
|
||||
0: "NONE",
|
||||
1: "IF_NEEDED",
|
||||
2: "PERIODIC",
|
||||
3: "ALWAYS",
|
||||
3: "FORCE_FLUSH",
|
||||
}
|
||||
|
||||
|
||||
@@ -389,8 +389,8 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
|
||||
# A node shutdown causes two flushes. One that flushes UTXOS_IN_CACHE
|
||||
# UTXOs and one that flushes 0 UTXOs. Normally the 0-UTXO-flush is the
|
||||
# second flush, however it can happen that the order changes.
|
||||
expected_flushes.append({"mode": "ALWAYS", "for_prune": False, "size": UTXOS_IN_CACHE})
|
||||
expected_flushes.append({"mode": "ALWAYS", "for_prune": False, "size": 0})
|
||||
expected_flushes.append({"mode": "FORCE_FLUSH", "for_prune": False, "size": UTXOS_IN_CACHE})
|
||||
expected_flushes.append({"mode": "FORCE_FLUSH", "for_prune": False, "size": 0})
|
||||
self.stop_node(0)
|
||||
|
||||
bpf.perf_buffer_poll(timeout=200)
|
||||
|
||||
Reference in New Issue
Block a user