refactor: replace pointers by references within tx_verify.{h,cpp} #19069

pull theStack wants to merge 1 commits into bitcoin:master from theStack:20200526-refactor-replace-pointers-by-refs-in-tx_verify changing 4 files +11 −11
  1. theStack commented at 2:20 pm on May 26, 2020: member

    This PR gets rid of another unnecessary use of raw pointers, similar to PR #19053 (see also issue #19062 where useful commands for finding potential candidates are listed) but in the tx verification module.

    For the functions CalculateSequenceLocks() and SequenceLocks(), the prevHeights vector parameter type is changed to be passed as a reference. Note that there were no checks for null pointers – if one would pass nullptr to one of the functions, the following line would immediately lead to a crash: https://github.com/bitcoin/bitcoin/blob/dcacea096e029a02a937bf96d002ca7e94c48c15/src/consensus/tx_verify.cpp#L32

  2. refactor: replace pointers by references within tx_verify.{h,cpp}
    affects "prevHeights" parameter of the functions
    - CalculateSequenceLocks()
    - SequenceLocks()
    b00266fe0c
  3. fanquake added the label Refactoring on May 26, 2020
  4. practicalswift commented at 3:17 pm on May 26, 2020: contributor
    Concept ACK: having compiler enforcement of preconditions is better than not having it (obviously) :)
  5. DrahtBot commented at 7:57 pm on May 27, 2020: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #17443 (Drop checkFinalTx and use Median Time Past to check finality of wallet transactions by ariard)
    • #17232 (Sanity assert GetAncestor() != nullptr where appropriate by adamjonas)

    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. MarcoFalke merged this on Jun 8, 2020
  7. MarcoFalke closed this on Jun 8, 2020

  8. sidhujag referenced this in commit b8f1025f30 on Jun 8, 2020
  9. jasonbcox referenced this in commit b2effc3882 on Nov 20, 2020
  10. theStack deleted the branch on Dec 1, 2020
  11. DrahtBot locked this on Feb 15, 2022

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-18 15:12 UTC

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