refactor: Remove confusing DataStream::in_avail() alias #35148

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2603-net-less-GetTime changing 2 files +63 −60
  1. maflcko commented at 10:53 AM on April 24, 2026: member

    The in_avail alias is confusing (see commit message), so remove it. Also extract the ProcessPong() helper, as the only place that called in_avail.

  2. move-only: Extract ProcessPong() helper
    This commit can be reviewed with the git options:
    --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
    fa5ab0220e
  3. streams: Remove confusing DataStream::in_avail()
    The alias of the size() method is confusing, because:
    
    * It claims to be part of the Bitcoin Core stream subset (streams
      interface), but this is not used by any other stream interface. Mostly
      the `write(std::span)` and `read(std::span)` define the stream
      interface.
    * It casts the size_t to i32, but the only place that calls the function
      casts that back to size_t.
    * Providing this alias for size() without a proper reason is confusing.
    
    Fix all issues by removing it and using the size() method.
    fa204100e1
  4. DrahtBot renamed this:
    refactor: Remove confusing DataStream::in_avail() alias
    refactor: Remove confusing DataStream::in_avail() alias
    on Apr 24, 2026
  5. DrahtBot added the label Refactoring on Apr 24, 2026
  6. DrahtBot commented at 10:53 AM on April 24, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK l0rinc, sedited

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35054 (p2p: UTXO set sharing by fjahr)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  7. l0rinc commented at 7:31 PM on April 24, 2026: contributor

    code review ACK fa204100e1456b14978071064112fce2acc527a6

    While it's not immediately obvious why the extraction was needed, it seems like a reasonable change. Redid the change locally, played a bit with various EXCLUSIVE_LOCKS_REQUIRED values, but the current implementation seems fine.

  8. sedited approved
  9. sedited commented at 8:15 AM on April 25, 2026: contributor

    ACK fa204100e1456b14978071064112fce2acc527a6

  10. sedited merged this on Apr 25, 2026
  11. sedited closed this on Apr 25, 2026

  12. sedited referenced this in commit 75f2bf1011 on Apr 25, 2026
  13. maflcko deleted the branch on May 6, 2026

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

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