Skip to content

Conversation

@l0rinc
Copy link
Contributor

@l0rinc l0rinc commented Dec 20, 2025

Minor follow-up to #33866

Reuse the should_empty predicate for both the write decision and for selecting CoinsTip().Flush() vs CoinsTip().Sync().
This is a pure refactor, no behavior is changed.

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 20, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34125.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #33680 (validation: do not wipe utxo cache for stats/scans/snapshots by l0rinc)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

In `Chainstate::FlushStateToDisk`, the condition for emptying the UTXO cache was duplicated: once in `should_write` and again when choosing between `CoinsTip().Flush()` and `CoinsTip().Sync()`.
Compute it once as `should_empty` and reuse it in both places.
@l0rinc l0rinc force-pushed the l0rinc/reuse-should-empty branch from 511582a to 66ab897 Compare January 3, 2026 10:59
@l0rinc
Copy link
Contributor Author

l0rinc commented Jan 3, 2026

#33866 was just merged, this PR is ready for review.

@l0rinc l0rinc marked this pull request as ready for review January 3, 2026 10:59
@l0rinc l0rinc mentioned this pull request Jan 14, 2026
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants