coins: group private cache helpers #35180

pull l0rinc wants to merge 1 commits into bitcoin:master from l0rinc:l0rinc/hide-coins-cache-helpers changing 1 files +13 −14
  1. l0rinc commented at 8:49 AM on April 30, 2026: contributor

    Problem: CCoinsViewCache::ReallocateCache() is public even though only Flush() uses it. The private helper declarations are also split between the start and end of the class.

    Fix: Move ReallocateCache() and FetchCoin() into the existing private section.

  2. DrahtBot added the label Refactoring on Apr 30, 2026
  3. DrahtBot commented at 8:49 AM on April 30, 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/35180.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK optout21, sedited

    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.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34132 (coins: drop error catcher, centralize fatal read handling 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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. optout21 commented at 1:35 PM on April 30, 2026: contributor

    Concept ACK 06040b4189a0db9c43c5570e62b9292e609c247e

  5. in src/coins.h:395 in db4f8ef633 outdated
     391 | @@ -392,9 +392,14 @@ class CCoinsViewBacked : public CCoinsView
     392 |  /** CCoinsView that adds a memory cache for transactions to another CCoinsView */
     393 |  class CCoinsViewCache : public CCoinsViewBacked
     394 |  {
     395 | -private:
    


    optout21 commented at 2:20 PM on May 5, 2026:

    db4f8ef coins: group private cache declarations:

    I'd prefer keeping the explicit private, even though it's unnecessary


    l0rinc commented at 7:36 PM on July 22, 2026:

    Done

  6. optout21 commented at 2:23 PM on May 5, 2026: contributor

    reACK c9cedebfffbc09c4394bbbe74da4ba0666237504

    No change, only rebase (refreshed ack in-place, no note-worthy status change).

    Prev: ACK 06040b4189a0db9c43c5570e62b9292e609c247e A minor, move-only refactor to reduce visibility of some CCoinsViewCache members.

  7. coins: group private cache helpers
    Move `FetchCoin()` and `ReallocateCache()` into the existing `private:` section.
    `ReallocateCache()` is only called internally by `Flush()`, and grouping both helpers removes the trailing access section.
    c9cedebfff
  8. l0rinc force-pushed on Jul 22, 2026
  9. l0rinc renamed this:
    move-only: hide coins cache internals
    coins: group private cache helpers
    on Jul 22, 2026
  10. l0rinc commented at 8:56 PM on July 22, 2026: contributor

    Rebased to resolve a silent merge conflict. The result is even simpler now.

  11. sedited approved
  12. sedited commented at 11:20 AM on August 5, 2026: contributor

    ACK c9cedebfffbc09c4394bbbe74da4ba0666237504

  13. sedited merged this on Aug 5, 2026
  14. sedited closed this on Aug 5, 2026

  15. l0rinc deleted the branch on Aug 5, 2026

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-08-11 10:51 UTC

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