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

Choose an address to connect to&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;CAddress, NodeSeconds&gt;
Select(
    bool new&lowbar;only = false,
    std::unordered&lowbar;set&lt;Network&gt; const& networks = &lcub;&rcub;) const;
----

== Return Value

CAddress The record for the selected peer&period; seconds The last time we attempted to connect to that peer&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *new&lowbar;only* [in]
| Whether to only select addresses from the new table&period; Passing `true` returns an address from the new table or an empty pair&period; Passing `false` will return an empty pair or an address from either the new or tried table (it does not guarantee a tried entry)&period;
| *networks* [in]
| Select only addresses of these networks (empty &equals; all)&period; Passing networks may slow down the search&period;
|===


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