[#CConnman-GetAddressesUnsafe]
= xref:CConnman.adoc[CConnman]::GetAddressesUnsafe
:relfileprefix: ../
:mrdocs:

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

== Synopsis

Declared in `&lt;net&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::vector&lt;CAddress&gt;
GetAddressesUnsafe(
    size&lowbar;t max&lowbar;addresses,
    size&lowbar;t max&lowbar;pct,
    std::optional&lt;Network&gt; network,
    bool filtered = true) const;
----

== Description

An untrusted caller (e&period;g&period; from p2p) should instead use xref:CConnman/GetAddresses.adoc[`GetAddresses`] to use the cache&period;

== Return Value

the selected addresses&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *max&lowbar;addresses* [in]
| Maximum number of addresses to return (0 &equals; all)&period;
| *max&lowbar;pct* [in]
| Maximum percentage of addresses to return (0 &equals; all)&period; Value must be from 0 to 100&period;
| *network* [in]
| Select only addresses of this network (nullopt &equals; all)&period;
| *filtered* [in]
| Select only addresses that are considered high quality (false &equals; all)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
