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
  1. gmaxwell commented at 1:26 AM on April 11, 2016: contributor

    This conserves resources from abusive peers that just send getaddr in a loop. Also makes correlating addr messages against INVs less effective.

  2. 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.
    66b07247a7
  3. dcousens commented at 6:53 AM on April 11, 2016: contributor

    utACK 66b0724

  4. laanwj added the label P2P on Apr 11, 2016
  5. jonasschnelli commented at 1:55 PM on April 11, 2016: contributor

    utACK 66b07247a7a9e48e082502338176cc06edf61474

  6. sipa commented at 1:52 PM on April 12, 2016: member

    utACK 66b0724

  7. 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 (getaddr from outbound connection). The space in the comment in the second line, before the word "and" is unintentional?

  8. laanwj commented at 7:03 AM on April 15, 2016: member

    Good idea. utACK 66b0724

  9. laanwj merged this on Apr 15, 2016
  10. laanwj closed this on Apr 15, 2016

  11. laanwj referenced this in commit 64e71b3721 on Apr 15, 2016
  12. codablock referenced this in commit 0831c14aa5 on Sep 16, 2017
  13. codablock referenced this in commit 4cd06a2194 on Sep 19, 2017
  14. codablock referenced this in commit 24f8c248f5 on Dec 20, 2017
  15. MarcoFalke 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 site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me