Limit the number of addressses for broadcast to accumulate #5419

pull sipa wants to merge 1 commits into bitcoin:master from sipa:limitaddr changing 1 files +9 −2
  1. sipa commented at 5:01 pm on December 3, 2014: member
  2. gmaxwell commented at 9:54 pm on December 3, 2014: contributor
    ACK.
  3. in src/net.h: in fb9571472d outdated
    369@@ -368,8 +370,13 @@ class CNode
    370         // Known checking here is only to save space from duplicates.
    371         // SendMessages will filter it again for knowns that were added
    372         // after addresses were pushed.
    373-        if (addr.IsValid() && !setAddrKnown.count(addr))
    374-            vAddrToSend.push_back(addr);
    375+        if (addr.IsValid() && !setAddrKnown.count(addr)) {
    376+            if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) {
    377+                vAddrToSend[GetRand(vAddrToSend.size())] = addr;
    


    laanwj commented at 11:59 am on December 4, 2014:
    I suppose insecure_rand is good enough here? GetRand can be slow.

    sipa commented at 12:19 pm on December 4, 2014:
    Done.
  4. laanwj added the label P2P on Dec 4, 2014
  5. laanwj added this to the milestone 0.10.0 on Dec 4, 2014
  6. laanwj commented at 12:00 pm on December 4, 2014: member
    Needs backport to 0.9 as well
  7. Limit the number of new addressses to accumulate 12a49cac0a
  8. sipa force-pushed on Dec 4, 2014
  9. laanwj merged this on Dec 5, 2014
  10. laanwj closed this on Dec 5, 2014

  11. laanwj referenced this in commit 68705996a9 on Dec 5, 2014
  12. mzumsande referenced this in commit ef98555800 on Aug 25, 2020
  13. mzumsande referenced this in commit d3eaaf4054 on Sep 3, 2020
  14. mzumsande referenced this in commit 628812a34e on Sep 6, 2020
  15. MarcoFalke locked this on Sep 8, 2021


sipa gmaxwell laanwj

Labels
P2P

Milestone
0.10.0


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: 2024-11-17 15:12 UTC

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