refactor: Use Txid in CMerkleBlock #28958

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2311-ref-txid- changing 5 files +15 −14
  1. maflcko commented at 3:55 PM on November 28, 2023: member

    This should also fix a gcc-13 compiler warning, see #28922 (review)

    rpc/txoutproof.cpp: In lambda function:
    rpc/txoutproof.cpp:72:33: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
       72 |                     const Coin& coin = AccessByTxid(active_chainstate.CoinsTip(), Txid::FromUint256(tx));
          |                                 ^~~~
    rpc/txoutproof.cpp:72:52: note: the temporary was destroyed at the end of the full expression ‘AccessByTxid((*(const CCoinsViewCache*)(&(& active_chainstate)->Chainstate::CoinsTip())), transaction_identifier<false>::FromUint256((* & tx)))’
       72 |                     const Coin& coin = AccessByTxid(active_chainstate.CoinsTip(), Txid::FromUint256(tx));
          |                                        ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1plus: all warnings being treated as errors
    
  2. DrahtBot commented at 3:55 PM on November 28, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK TheCharlatan, dergoegge

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Refactoring on Nov 28, 2023
  4. maflcko force-pushed on Nov 28, 2023
  5. maflcko force-pushed on Nov 28, 2023
  6. maflcko force-pushed on Nov 28, 2023
  7. dergoegge commented at 4:07 PM on November 28, 2023: member

    Concept ACK

  8. in src/test/merkleblock_tests.cpp:30 in fa665711a0 outdated
      28 | -    uint256 txhash1 = uint256S("0x74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20");
      29 | +    Txid txhash1{Txid::FromUint256(uint256S("0x74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20"))};
      30 |  
      31 |      // Second txn in block.
      32 | -    uint256 txhash2 = uint256S("0xf9fc751cb7dc372406a9f8d738d5e6f8f63bab71986a39cf36ee70ee17036d07");
      33 | +    Txid txhash2{Txid::FromUint256(uint256S("0xf9fc751cb7dc372406a9f8d738d5e6f8f63bab71986a39cf36ee70ee17036d07"))};
    


    dergoegge commented at 4:17 PM on November 28, 2023:

    nit: Could use TxidFromString here


    maflcko commented at 4:50 PM on November 28, 2023:

    Thanks, done

  9. dergoegge approved
  10. dergoegge commented at 4:19 PM on November 28, 2023: member

    Code review ACK fa665711a00b2e39954848160b3e70c60730b276

  11. TheCharlatan approved
  12. TheCharlatan commented at 4:47 PM on November 28, 2023: contributor

    ACK fa665711a00b2e39954848160b3e70c60730b276

  13. refactor: Use Txid in CMerkleBlock fa02c08c93
  14. maflcko force-pushed on Nov 28, 2023
  15. TheCharlatan commented at 7:33 AM on November 29, 2023: contributor

    Re-ACK fa02c08c93e5867b7ea07d79ca1c0917dcde88e0

  16. DrahtBot requested review from dergoegge on Nov 29, 2023
  17. dergoegge approved
  18. dergoegge commented at 10:04 AM on November 29, 2023: member

    reACK fa02c08c93e5867b7ea07d79ca1c0917dcde88e0

  19. fanquake merged this on Nov 29, 2023
  20. fanquake closed this on Nov 29, 2023

  21. fanquake commented at 10:55 AM on November 29, 2023: member
  22. maflcko deleted the branch on Nov 29, 2023
  23. achow101 commented at 5:24 PM on November 29, 2023: member

    Post merge ACK fa02c08c93e5867b7ea07d79ca1c0917dcde88e0

  24. bitcoin locked this on Nov 28, 2024

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:13 UTC

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