100 const auto& address = addrman.Select();
101 assert(address.first.GetPort() > 0);
117 (
void)addrman.Select();
136 (
void)addrman.Select(
false, {NET_I2P});
147 const auto&
addresses = addrman.GetAddr(2500, 23, std::nullopt);
static void AddrManSelectByNetwork(benchmark::Bench &bench)
static void AddrManSelectFromAlmostEmpty(benchmark::Bench &bench)
static void FillAddrMan(AddrMan &addrman)
static void AddrManSelect(benchmark::Bench &bench)
static void AddrManAddThenGood(benchmark::Bench &bench)
static constexpr size_t NUM_SOURCES
static constexpr uint32_t ADDRMAN_CONSISTENCY_CHECK_RATIO
static std::vector< CAddress > g_sources
static void AddrManGetAddr(benchmark::Bench &bench)
static auto EMPTY_NETGROUPMAN
static constexpr size_t NUM_ADDRESSES_PER_SOURCE
static void CreateAddresses()
static void AddAddressesToAddrMan(AddrMan &addrman)
static void AddrManAdd(benchmark::Bench &bench)
static std::vector< std::vector< CAddress > > g_addresses
Stochastic address manager.
bool Add(const std::vector< CAddress > &vAddr, const CNetAddr &source, std::chrono::seconds time_penalty=0s)
Attempt to add one or more addresses to addrman's new table.
A CService with information about it as peer.
bool SetSpecial(std::string_view addr)
Parse a Tor or I2P address and set this object to it.
A combination of a network address (CNetAddr) and a (TCP) port.
static NetGroupManager NoAsmap()
std::vector< B > randbytes(size_t len) noexcept
Generate random bytes.
Main entry point to nanobench's benchmarking facility.
std::vector< CNetAddr > LookupHost(const std::string &name, unsigned int nMaxSolutions, bool fAllowLookup, DNSLookupFn dns_lookup_function)
Resolve a host string to its corresponding network addresses.
std::vector< CService > Lookup(const std::string &name, uint16_t portDefault, bool fAllowLookup, unsigned int nMaxSolutions, DNSLookupFn dns_lookup_function)
Resolve a service string to its corresponding service.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.