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-
sipa commented at 5:01 pm on December 3, 2014: member
-
gmaxwell commented at 9:54 pm on December 3, 2014: contributorACK.
-
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 supposeinsecure_rand
is good enough here? GetRand can be slow.
sipa commented at 12:19 pm on December 4, 2014:Done.laanwj added the label P2P on Dec 4, 2014laanwj added this to the milestone 0.10.0 on Dec 4, 2014laanwj commented at 12:00 pm on December 4, 2014: memberNeeds backport to 0.9 as wellLimit the number of new addressses to accumulate 12a49cac0asipa force-pushed on Dec 4, 2014laanwj merged this on Dec 5, 2014laanwj closed this on Dec 5, 2014
laanwj referenced this in commit 68705996a9 on Dec 5, 2014mzumsande referenced this in commit ef98555800 on Aug 25, 2020mzumsande referenced this in commit d3eaaf4054 on Sep 3, 2020mzumsande referenced this in commit 628812a34e on Sep 6, 2020MarcoFalke 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: 2024-12-19 06:12 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: 2024-12-19 06:12 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