util: atomically write banlist.json and rename WriteSettings to WriteJsonUnsafe #35763

pull kevkevinpal wants to merge 1 commits into bitcoin:master from kevkevinpal:banlist-atomic-write-json-unsafe changing 5 files +42 −10
  1. kevkevinpal commented at 12:47 PM on July 21, 2026: contributor

    Summary

    This is a follow-up to #35384 (comment)

    • CBanDB::Write now writes banlist.json.tmp and uses RenameOver, so a failed/interrupted write can’t leave a truncated banlist.json (same pattern as settings.json).
    • Renamed common::WriteSettings → common::WriteJsonUnsafe and documented that callers must pair it with an atomic rename.
    • Added a unit test that checks the write/read roundtrip and that the .tmp file is gone after success.
  2. util: atomically write banlist.json and rename WriteSettings to WriteJsonUnsafe 07ec5af152
  3. DrahtBot added the label Utils/log/libs on Jul 21, 2026
  4. DrahtBot commented at 12:47 PM on July 21, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    Concept ACK winterrdog

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. winterrdog commented at 5:42 PM on July 21, 2026: contributor

    Concept ACK

    Thanks for picking these up.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-25 06:50 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me