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.
[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-
amitiuttarwar commented at 2:27 AM on March 9, 2021: contributor
-
ebde946a52
[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.
- fanquake added the label Docs on Mar 9, 2021
- fanquake added the label P2P on Mar 9, 2021
-
Empact commented at 6:52 AM on March 9, 2021: member
-
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
ChainSyncTimeoutStateshould 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.
-
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.
- fanquake merged this on Mar 12, 2021
- fanquake closed this on Mar 12, 2021
- sidhujag referenced this in commit 7eb819d1ca on Mar 12, 2021
- DrahtBot locked this on Aug 16, 2022
Contributors