refactor: Make CCoinsCacheEntry::Flags enum private #31496

pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2024/12/30906_followup changing 1 files +21 −21
  1. hodlinator commented at 10:34 pm on December 13, 2024: contributor

    Follow-up to #30906 which made it possible by removing external usage of the enum.

    Move-only change, reviewable using: --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space

  2. refactor: Make CCoinsCacheEntry::Flags enum private e4121ad0d6
  3. DrahtBot commented at 10:34 pm on December 13, 2024: contributor

    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/31496.

    Reviews

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

  4. DrahtBot added the label Refactoring on Dec 13, 2024
  5. l0rinc commented at 10:45 pm on December 13, 2024: contributor
    We want to completely remove the flags in the future since we’re storing it redundantly (cc @andrewtoth), so this move is a nack from me.
  6. andrewtoth commented at 10:58 pm on December 13, 2024: contributor
    As @l0rinc alluded, we don’t really need flags at all anymore. A dirty entry is one that is spent or is FRESH. So, we only really need a binary state now, not a bitfield, so we can replace flags with an m_fresh boolean. IsDirty() can return coin.IsSpent() || m_fresh.
  7. hodlinator commented at 11:05 pm on December 13, 2024: contributor
    Ookay.. closing suggested follow-up PR due to unexpected welcome. :upside_down_face:
  8. hodlinator closed this on Dec 13, 2024

  9. andrewtoth commented at 11:07 pm on December 13, 2024: contributor
    Well, what about a PR with that approach to remove the flags bitfield and replace with a boolean for fresh only?
  10. hodlinator commented at 11:12 pm on December 13, 2024: contributor

    Well, what about a PR with that approach to remove the flags bitfield and replace with a boolean for fresh only?

    I’d prefer someone else more knowledgeable/active in this area take the initiative on such a transform.

  11. l0rinc commented at 3:38 pm on December 14, 2024: contributor

    I’d prefer someone else more knowledgeable/active in this area take the initiative on such a transform.

    We can help with the reviews - or even with describing the problem in more detail, but removing the flags (as described by @andrewtoth above) would be a lot more meaningful than just moving the flags.


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: 2024-12-21 12:12 UTC

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