refactor: make GetRand a template, remove GetRandInt #24925

pull PastaPastaPasta wants to merge 1 commits into bitcoin:master from PastaPastaPasta:refactor-random-2 changing 12 files +34 −31
  1. PastaPastaPasta commented at 6:50 PM on April 19, 2022: contributor

    makes GetRand a template for which any integral type can be used, where the default behavior is to return a random integral up to the max of the integral unless a max is provided. This simplifies a lot of code from GetRand(std::numeric_limits<uint64_t>::max() -> GetRand<uint64_t>()

  2. DrahtBot added the label P2P on Apr 19, 2022
  3. DrahtBot added the label Refactoring on Apr 19, 2022
  4. DrahtBot added the label RPC/REST/ZMQ on Apr 19, 2022
  5. DrahtBot added the label Utils/log/libs on Apr 19, 2022
  6. DrahtBot added the label UTXO Db and Indexes on Apr 19, 2022
  7. DrahtBot added the label Wallet on Apr 19, 2022
  8. DrahtBot commented at 3:18 PM on April 20, 2022: member

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

    • #24974 (refactor: Make FEELER_SLEEP_WINDOW type safe (std::chrono) by MarcoFalke)
    • #24185 (refactor: only use explicit reinterpret/const casts, not implicit by PastaPastaPasta)

    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.

  9. laanwj renamed this:
    refactor: make GetRand a template, remove GetRandInt by PastaPastaPasta
    refactor: make GetRand a template, remove GetRandInt
    on Apr 21, 2022
  10. laanwj removed the label Wallet on Apr 21, 2022
  11. laanwj removed the label UTXO Db and Indexes on Apr 21, 2022
  12. laanwj removed the label RPC/REST/ZMQ on Apr 21, 2022
  13. laanwj removed the label P2P on Apr 21, 2022
  14. PastaPastaPasta force-pushed on Apr 21, 2022
  15. DrahtBot added the label Needs rebase on Apr 22, 2022
  16. refactor: make GetRand a template, remove GetRandInt ab1ea29ba1
  17. PastaPastaPasta force-pushed on Apr 22, 2022
  18. DrahtBot removed the label Needs rebase on Apr 22, 2022
  19. fanquake commented at 11:00 AM on May 6, 2022: member

    @laanwj you might be interested in taking a look here?

  20. laanwj commented at 12:25 PM on May 11, 2022: member

    Code review ACK ab1ea29ba1b8379a21fabd3dc859552c470a6421 I like how this gets rid of a lot of reinterpret_casts (punning integers as bytes).

  21. MarcoFalke merged this on May 12, 2022
  22. MarcoFalke closed this on May 12, 2022

  23. sidhujag referenced this in commit 1e76e33480 on May 13, 2022
  24. DrahtBot locked this on May 12, 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: 2026-04-13 15:14 UTC

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