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.
Declared in <net.h>
std::vector<CAddress>
GetAddresses(
CNode& requestor,
size_t max_addresses,
size_t max_pct);
A trusted caller (e.g. from RPC or a peer with addr permission) can use GetAddressesUnsafe to avoid using the cache.
the cached (or freshly cached) addresses for this requestor.
| 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. |