[#CConnman-GetAddresses] = xref:CConnman.adoc[CConnman]::GetAddresses :relfileprefix: ../ :mrdocs: Return addresses from the per‐requestor cache. If no cache entry exists, it is populated with randomly selected addresses. This function can be used in untrusted contexts. == Synopsis Declared in `<net.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::vector<CAddress> GetAddresses( xref:CNode.adoc[CNode]& requestor, size_t max_addresses, size_t max_pct); ---- == Description A trusted caller (e.g. from RPC or a peer with addr permission) can use xref:CConnman/GetAddressesUnsafe.adoc[`GetAddressesUnsafe`] to avoid using the cache. == Return Value the cached (or freshly cached) addresses for this requestor. == Parameters [cols="1,4"] |=== | Name| Description | *requestor* [in] | The requesting peer. Used to key the cache to prevent privacy leaks. | *max_addresses* [in] | Maximum number of addresses to return (0 = all). Ignored when cache already contains an entry for requestor. | *max_pct* [in] | Maximum percentage of addresses to return (0 = all). Value must be from 0 to 100. Ignored when cache already contains an entry for requestor. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#