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.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34125.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process. A summary of reviews will appear here.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
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.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
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.
<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.