Choose an address to connect to.

Synopsis

Declared in <addrman.h>

std::pair<CAddress, NodeSeconds>
Select(
    bool new_only = false,
    std::unordered_set<Network> const& networks = {}) const;

Return Value

CAddress The record for the selected peer. seconds The last time we attempted to connect to that peer.

Parameters

Name

Description

new_only [in]

Whether to only select addresses from the new table. Passing true returns an address from the new table or an empty pair. Passing false will return an empty pair or an address from either the new or tried table (it does not guarantee a tried entry).

networks [in]

Select only addresses of these networks (empty = all). Passing networks may slow down the search.

Created with MrDocs