Drop BanLevel in favor of Optional<BanReason> #16038

pull Empact wants to merge 2 commits into bitcoin:master from Empact:drop-ban-level changing 7 files +29 −41
  1. Empact commented at 9:50 PM on May 16, 2019: member

    BanLevel was a very narrow concept which served a limited purpose. Removing it removes a layer of indirection.

    Alternative to #16018 Fixes #15929

  2. Drop BanLevel in favor of Optional<BanReason>
    BanLevel was a very narrow type which served a limited purpose. Removing
    it removes a layer of indirection.
    09b703ebbd
  3. fanquake added the label P2P on May 16, 2019
  4. Make BanReason an enum class b7866cf6d8
  5. DrahtBot commented at 10:42 PM on May 16, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #16018 (banman: BanLevel enum by dakk)

    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.

  6. gmaxwell commented at 11:01 PM on May 16, 2019: contributor

    This PR gives no rational at to how it improves the software for the users and is incompatible with the considered future use of creating using banning as a priority. The use of an Optional type needlessly complicates and embrittles the code (e.g. having to insert additional != nullopt checks).

  7. sdaftuar commented at 12:43 AM on May 17, 2019: member

    Concept NACK. I just posted in #15929 that I think all this discussion around style/refactor of code whose behavior is not being changed is a waste of effort. Let's revisit the implementation when the behavior involved gets extended or improved instead.

  8. Empact commented at 1:40 AM on May 17, 2019: member

    Thanks guys. I don’t believe it’s categorically a waste of effort, as if no cleanup is done along the way, even a consistently well-implemented incrementally advanced project will accumulate significant and problematic technical debt over time, or will fail to apply improvements that would otherwise reduce the risk of issues in the future - a minor example of this is moving to switches that error when a new case is added but not handled.

    But I’m sympathetic to the argument that this is not the change to prioritize wrt time and attention, given its impact.

    Greg, I’ll take your point about refocusing on user benefit.

  9. Empact closed this on May 17, 2019

  10. Empact deleted the branch on May 17, 2019
  11. DrahtBot locked this on Dec 16, 2021

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-04-17 12:14 UTC

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