refactor: Use NodeClock::time_point for m_addr_token_timestamp #34059

pull maflcko wants to merge 4 commits into bitcoin:master from maflcko:2512-net-less-GetTime changing 1 files +88 −84
  1. maflcko commented at 2:15 pm on December 12, 2025: member

    It is a bit confusing to have some code use the deprecated GetTime, which returns a duration and not a time point, and other code to use NodeClock time points.

    Fix one place m_addr_token_timestamp to use NodeClock::time_point.

    Also:

    • Extract a ProcessAddrs helper, similar to the other Process*() helpers, to cut down the ProcessMessage with a massive scope.
    • Rename the confusing current_a_time to now_seconds. (The a in this context refers to the removed “adjusted” time, see commit fadd8b2676f6d68ec87189871461c9a6a6aa3cac, which removed adjusted time here)
  2. move-only: Extract ProcessAddrs() helper
    This can be reviewed via the git options:
    --color-moved=dimmed-zebra  --color-moved-ws=ignore-all-space
    fae7b7e967
  3. refactor: Pass Peer& to ProcessAddrs()
    The peer is never nullptr, so a reference makes more sense.
    
    This can be reviewed via the git option:
    --word-diff-regex=.
    fa12d643f6
  4. refactor: Use NodeClock::time_point for m_addr_token_timestamp
    This refactor makes the field a bit more type-safe.
    fafd744f4e
  5. refactor: Rename current_a_time to now_seconds
    This better reflects the meaning and use.
    1111b9bc67
  6. DrahtBot renamed this:
    refactor: Use NodeClock::time_point for m_addr_token_timestamp
    refactor: Use NodeClock::time_point for m_addr_token_timestamp
    on Dec 12, 2025
  7. DrahtBot added the label Refactoring on Dec 12, 2025
  8. DrahtBot commented at 2:15 pm on December 12, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34059.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Approach ACK ajtowns

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  9. ajtowns commented at 11:45 pm on December 12, 2025: contributor

    What do you think of getting all the peer->foo to peer.foo noise done first, rather than doing it bit by bit? Here’s a scripted-diff approach that might be easy to review: https://github.com/ajtowns/bitcoin/commits/202512-peer-by-ref/

    Approach ACK otherwise


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: 2025-12-13 18:12 UTC

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