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: contributor

    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: contributor

    <!--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:

    • #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. DrahtBot cross-referenced this on May 28, 2020 from issue Drop checkFinalTx and use Median Time Past to check finality of wallet transactions by ariard
  7. DrahtBot cross-referenced this on May 28, 2020 from issue Sanity assert GetAncestor() != nullptr where appropriate by adamjonas
  8. MarcoFalke merged this on Jun 8, 2020
  9. MarcoFalke closed this on Jun 8, 2020

  10. sidhujag referenced this in commit b8f1025f30 on Jun 8, 2020
  11. jasonbcox referenced this in commit b2effc3882 on Nov 20, 2020
  12. theStack deleted the branch on Dec 1, 2020
  13. bitcoin 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: 2026-05-20 06:54 UTC