refactor: Use NodeClock::time_point in more places #35315

pull maflcko wants to merge 7 commits into bitcoin:master from maflcko:2603-net-less-GetTime changing 24 files +169 −174
  1. maflcko commented at 3:21 PM on May 18, 2026: 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 all places in net_processing.cpp to properly use time_point types.

  2. DrahtBot added the label Refactoring on May 18, 2026
  3. DrahtBot commented at 3:21 PM on May 18, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35502 (refactor: extract per-message helpers from ProcessMessage (move-only) by w0xlt)
    • #35406 (private broadcast: limit outstanding txs to count of 1000 by instagibbs)
    • #34824 (net: refactor: replace Peer::TxRelay RecursiveMutex instances with Mutex by w0xlt)
    • #34743 (p2p: don't disconnect manual peers for block stalling by willcl-ark)
    • #34565 (refactor: extract BlockDownloadManager from PeerManagerImpl by w0xlt)
    • #27052 (test: rpc: add last block announcement time to getpeerinfo result by LarryRuane)

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

  4. maflcko force-pushed on May 18, 2026
  5. DrahtBot added the label CI failed on May 18, 2026
  6. DrahtBot commented at 3:50 PM on May 18, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task test ancestor commits: https://github.com/bitcoin/bitcoin/actions/runs/26042826463/job/76558889400</sub> <sub>LLM reason (✨ experimental): CI failed because the build stopped with a Clang -Werror error: rpcconsole.cpp has an unused variable (time_now).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. maflcko force-pushed on May 18, 2026
  8. DrahtBot removed the label CI failed on May 18, 2026
  9. refactor: Allow NodeClock::epoch to be used in NodeSeconds context
    Some contexts have only second precision by definition, and it should be
    allowed to use NodeClock::epoch as an alias for zero.
    fa10abb295
  10. refactor: Use NodeSeconds for m_best_block_time
    Previously, it was using a duration type.
    fa1a22927a
  11. refactor: Use NodeClock::time_point for m_last_block_announcement
    Previously, a raw i64 was used, which also required a cast to seconds.
    fa67c65151
  12. refactor: Use NodeClock::time_point in txdownloadman/txrequest fae925ff92
  13. refactor: Use NodeClock::time_point instead of std::chrono::seconds
    for:
    * ConsiderEviction()
    * m_last_tip_update
    * m_stale_tip_check_time
    * m_last_block_time
    * m_last_tx_time
    fa72cdf956
  14. refactor: Use NodeClock::time_point instead of std::chrono::microseconds
    for fields:
    
    * m_headers_sync_timeout
    * m_downloading_since
    * m_next_send_feefilter
    * m_next_addr_send
    * m_next_local_addr_send
    * m_next_inv_send_time
    * m_stalling_since
    cccc80ec09
  15. refactor: Use NodeClock for last GetTime call in net_processing.cpp fa14855ff1
  16. maflcko force-pushed on May 29, 2026
Contributors

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-06-13 21:30 UTC

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