ADDR response to GETADDR only contains 1000 addresses at most #19458

issue jpeisenbarth opened this issue on July 7, 2020
  1. jpeisenbarth commented at 8:45 AM on July 7, 2020: none

    Hello,

    There are two constants that set the number of addresses sent in an ADDR message to max(23% of the tables content 2500) : ADDRMAN_GETADDR_MAX_PCT and ADDRMAN_GETADDR_MAX

    https://github.com/bitcoin/bitcoin/blob/b52e25cc1be3771cad26c6c3cdbc0b81f96597ec/src/addrman.h#L156-L160

    They are used here, in the call connman->GetAddresses(); and vAddr contains max(23% of the tables, 2500) elements.

    https://github.com/bitcoin/bitcoin/blob/b52e25cc1be3771cad26c6c3cdbc0b81f96597ec/src/net_processing.cpp#L3326-L3332

    But in the end, there are only 1000 addresses sent at most because of pfrom.PushAddress(addr, insecure_rand);

    https://github.com/bitcoin/bitcoin/blob/b52e25cc1be3771cad26c6c3cdbc0b81f96597ec/src/net.h#L952-L965

    https://github.com/bitcoin/bitcoin/blob/b52e25cc1be3771cad26c6c3cdbc0b81f96597ec/src/net.h#L54

    Why is there a selection of 23% of the tables new or tried (or 2500) when at the end it is cropped to 1000 ? or maybe did I miss something ?

  2. fanquake added the label P2P on Jul 7, 2020
  3. naumenkogs commented at 10:44 AM on July 7, 2020: member

    You are not missing anything, we were just discussing it here.

    I think this was overlooked and never bothered anyone, because it doesn't introduce any issues beyond a slight inefficiency. Unless we fix it in the PR I linked above, someone can make a separate PR addressing this specific issue.

  4. jpeisenbarth commented at 10:54 AM on July 7, 2020: none

    Oh yes, I didn't see this issue, thank you, I'll close this one and follow the one you linked

  5. jpeisenbarth closed this on Jul 7, 2020

  6. naumenkogs commented at 11:27 AM on July 7, 2020: member

    That PR is not entirely about this issue, but yeah, perhaps making some decision there is better than spreading over several issues :)

  7. DrahtBot locked this on Feb 15, 2022
Labels

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-26 06:14 UTC

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