CAddrMan.GetAddr() would previously liCommit the number and percentage ofdescription:
addresses returned (to ADDRMAN_GETADDR_MAX (1000) and> CAddrMan.GetAddr() would previously limit the number and percentage of
ADDRMAN_GETADDR_MAX_PCT (23) respectively). Instead, make it the callers> addresses returned (to ADDRMAN_GETADDR_MAX (1000) and
responsibility to specify the maximum addresses and percentage> ADDRMAN_GETADDR_MAX_PCT (23) respectively). Instead, make it they want callers
returned.
For net_processing,> responsibility to specify the maximums are MAX_ADDR_TO_SEND (1000) and addresses and percentage they want
MAX_PCT_ADDR_TO_SEND (23). For rpc/net, the maximum is specified by the> returned.
client.>
> For net_processing, the maximums are MAX_ADDR_TO_SEND (1000) and
> MAX_PCT_ADDR_TO_SEND (23). For rpc/net, the maximum is specified by the
> client.
>
PR description:
> Currently addrman only allows a maximum of 1000 records or 23% of all records to be returned in a call to GetAddr(). Relax this limit and have the client specify the max records they want. For p2p, behaviour is unchanged (but the rate limiting is set inside net_processing, where it belongs). For RPC, getnodeaddresses can now return the complete addrman, which is helpful for testing and monitoring.
>
> Also add a test-only RPC addpeeraddress, which adds an IP address:port to addrman. This is helpful for testing (eg #18991).
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19658 | core#19658]] [1/3]
https://github.com/bitcoin/bitcoin/pull/19658/commits/f26502e9fc8a669b30717525597e3f468eaecf79