refactor: make active_chain_tip a reference #25677

pull aureleoules wants to merge 1 commits into bitcoin:master from aureleoules:2022-07-make-active-chain-ref changing 3 files +11 −12
  1. aureleoules commented at 1:51 pm on July 22, 2022: member

    This PR fixes a TODO introduced in #21055.

    Makes active_chain_tip argument in CheckFinalTxAtTip function a reference instead of a pointer.

  2. refactor: make active_chain_tip a reference 9376a6dae4
  3. DrahtBot added the label Refactoring on Jul 22, 2022
  4. DrahtBot commented at 1:06 am on July 23, 2022: contributor

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25073 (test: Cleanup miner_tests by MarcoFalke)
    • #23897 (refactor: Move calculation logic out from CheckSequenceLocksAtTip() by hebasto)

    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.

  5. fanquake commented at 3:37 pm on August 5, 2022: member
  6. dongcarl commented at 11:08 pm on August 11, 2022: contributor

    ACK 9376a6dae41022874df3b9302667796a9fb7b81d

    I’m guessing cuz the reference is const it’s getting lifetime extension?

  7. MarcoFalke merged this on Aug 12, 2022
  8. MarcoFalke closed this on Aug 12, 2022

  9. MarcoFalke commented at 7:10 am on August 12, 2022: member

    I’m guessing cuz the reference is const it’s getting lifetime extension?

    I don’t think any lifetimes change here, as passing a reference as a parameter is lifetime-wise identical to passing a pointer. Also, lifetimes shouldn’t matter here, as the function does not return the reference/pointer or otherwise stores it in memory that survives past the return of the function.

    If you are asking whether a temporary can now be passed into the function: Then yes, this is now possible and legal C++ code. However for the purposes of our validation code creating a temporary is just as illegal as creating a copy, see #25311.

  10. sidhujag referenced this in commit d01f1834e0 on Aug 12, 2022
  11. aureleoules deleted the branch on Aug 25, 2022
  12. bitcoin locked this on Aug 25, 2023

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

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