Return randomly selected addresses. This function does not use the address response cache and should only be used in trusted contexts.

Synopsis

Declared in <net.h>

std::vector<CAddress>
GetAddressesUnsafe(
    size_t max_addresses,
    size_t max_pct,
    std::optional<Network> network,
    bool filtered = true) const;

Description

An untrusted caller (e.g. from p2p) should instead use GetAddresses to use the cache.

Return Value

the selected addresses.

Parameters

Name

Description

max_addresses [in]

Maximum number of addresses to return (0 = all).

max_pct [in]

Maximum percentage of addresses to return (0 = all). Value must be from 0 to 100.

network [in]

Select only addresses of this network (nullopt = all).

filtered [in]

Select only addresses that are considered high quality (false = all).

Created with MrDocs