This conserves resources from abusive peers that just send getaddr in a loop. Also makes correlating addr messages against INVs less effective.
Only send one GetAddr response per connection. #7856
pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:addr_once changing 3 files +10 −0-
gmaxwell commented at 1:26 AM on April 11, 2016: contributor
-
66b07247a7
Only send one GetAddr response per connection.
This conserves resources from abusive peers that just send getaddr in a loop. Also makes correlating addr messages against INVs less effective.
-
dcousens commented at 6:53 AM on April 11, 2016: contributor
utACK 66b0724
- laanwj added the label P2P on Apr 11, 2016
-
jonasschnelli commented at 1:55 PM on April 11, 2016: contributor
utACK 66b07247a7a9e48e082502338176cc06edf61474
-
sipa commented at 1:52 PM on April 12, 2016: member
utACK 66b0724
-
in src/main.cpp:None in 66b07247a7
5213 | @@ -5214,6 +5214,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, 5214 | return true; 5215 | } 5216 | 5217 | + // Only send one GetAddr response per connection to reduce resource waste 5218 | + // and discourage addr stamping of INV announcements. 5219 | + if (pfrom->fSentAddr) { 5220 | + LogPrint("net", "Ignoring repeated \"getaddr\". peer=%d\n", pfrom->id);
paveljanik commented at 8:04 PM on April 12, 2016:Cosmetic nits: The dot before peer looks ugly, but the same style is used above (
getaddrfrom outbound connection). The space in the comment in the second line, before the word "and" is unintentional?paveljanik commented at 8:04 PM on April 12, 2016: contributortheuni commented at 2:30 AM on April 13, 2016: memberlaanwj commented at 7:03 AM on April 15, 2016: memberGood idea. utACK 66b0724
laanwj merged this on Apr 15, 2016laanwj closed this on Apr 15, 2016laanwj referenced this in commit 64e71b3721 on Apr 15, 2016codablock referenced this in commit 0831c14aa5 on Sep 16, 2017codablock referenced this in commit 4cd06a2194 on Sep 19, 2017codablock referenced this in commit 24f8c248f5 on Dec 20, 2017MarcoFalke locked this on Sep 8, 2021
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-14 21:15 UTC
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-14 21:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me