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
They are used here, in the call connman->GetAddresses(); and vAddr contains max(23% of the tables, 2500) elements.
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 ?