[#AddrMan-GetAddr]
= xref:AddrMan.adoc[AddrMan]::GetAddr
:relfileprefix: ../
:mrdocs:

Return all or many randomly selected addresses, optionally by network&period;

== Synopsis

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

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

== Return Value

A vector of randomly selected addresses from vRandom&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 good quality (false &equals; all)&period;
|===


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