Rationalize the CValidationState interface by splitting ::DoS across ::Invalid and ::Corrupt #12357

pull Empact wants to merge 5 commits into bitcoin:master from Empact:validation-state-corrupt changing 3 files +115 −102
  1. Empact commented at 3:58 PM on February 5, 2018: member

    This removes the always-false return argument, and splits the DoS responsibility across, ::Invalid, and ::Corrupt which together encode the possiblyCorrupt argument into a method-level concern. This makes the interface more explicit by making this literal argument self-explanatory, and by not separating the message strings.

  2. sdaftuar commented at 4:03 PM on February 5, 2018: member

    I believe #11639 reworks some of this as well?

  3. Empact commented at 4:36 PM on February 5, 2018: member

    Looks like they are compatible, but whichever is second would need to be rebased / adapted.

  4. Drop return argument from CValidationState::Invalid
    It's false in every case.
    1a6ead3d53
  5. Drop return argument from CValidationState::DoS
    It was always false. Note error() always returns false.
    d754cc953e
  6. Drop unused default arguments to CValidationState::DoS and ::Invalid 5e48f5687b
  7. Make the level explicit for CValidationState::Invalid 32005810b2
  8. Introduce CValidationState::Corrupt and privatize ::DoS
    ::Invalid, and ::Corrupt together encode the possiblyCorrupt argument into
    a method-level concern. This makes the interface more explicit by making
    this literal argument self-explanatory, and by not separating the
    message strings.
    6d4d5f7461
  9. Empact force-pushed on Feb 5, 2018
  10. fanquake added the label Refactoring on Feb 5, 2018
  11. fanquake added the label Validation on Feb 5, 2018
  12. JeremyRubin commented at 4:03 AM on February 7, 2018: contributor

    This is a subset of changes made in #11523.

    I can rebase it if there's any demand for that work (it seemed not to be the case?)

  13. Empact commented at 7:23 AM on February 7, 2018: member

    Ah thanks Jeremy, didn’t see yours. Agree there are some clear improvements to be made here. I’ll leave this open and comment on yours.

  14. Empact commented at 8:49 PM on February 16, 2018: member

    Going for a more incremental approach, in hopes of simplifying review. #12463

  15. Empact closed this on Feb 16, 2018

  16. Empact deleted the branch on Feb 16, 2018
  17. MarcoFalke locked this on Sep 8, 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-22 06:15 UTC

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