[doc] Improve comment about protected peers #21394

pull amitiuttarwar wants to merge 1 commits into bitcoin:master from amitiuttarwar:2021-03-doc changing 1 files +1 −1
  1. amitiuttarwar commented at 2:27 AM on March 9, 2021: contributor

    The comment currently suggests a long-standing node would infrequently protect peers under normal circumstances. Clarify that we also protect peers that are synced to the same work as our chain tip. Relevant check here.

  2. [doc] Improve comment about protected peers
    The comment currently suggests a long-standing node would infrequently protect
    peers under normal circumstances. Clarify that we also protect peers that are
    synced to the same work as our chain tip.
    ebde946a52
  3. fanquake added the label Docs on Mar 9, 2021
  4. fanquake added the label P2P on Mar 9, 2021
  5. jnewbery commented at 10:29 AM on March 9, 2021: member

    ACK ebde946a527e50630df180c6565ea5bf8d2ab5aa

    This corrects an obviously incorrect comment. However, I don't think the code comment on ChainSyncTimeoutState should be there at all:

    • it's rephrasing in English what the code is already saying in C++ (incorrectly, prior to this PR). Comments should explain why the code is doing something, not what it's doing, since the code already documents what the code does, and 100% accurately.
    • it's documenting logic that is hundreds of lines away from the comment. Distant comments inevitably become outdated as the logic changes.
  6. amitiuttarwar commented at 4:10 AM on March 10, 2021: contributor

    @jnewbery agreed! I'd much prefer if the comment gave context around why we protect peers. I've noted it down for a future improvement.

  7. fanquake merged this on Mar 12, 2021
  8. fanquake closed this on Mar 12, 2021

  9. sidhujag referenced this in commit 7eb819d1ca on Mar 12, 2021
  10. DrahtBot locked this on Aug 16, 2022

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-20 18:14 UTC

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