76 AddrMan addrman( std::vector<bool>(),
86 AddrMan addrman( std::vector<bool>(),
92 const auto &address = addrman.
Select();
93 assert(address.first.GetPort() > 0);
98 AddrMan addrman( std::vector<bool>(),
133 AddrMan addrman(std::vector<bool>(),
static void FillAddrMan(AddrMan &addrman)
static void AddrManSelect(benchmark::Bench &bench)
static void AddrManAddThenGood(benchmark::Bench &bench)
static constexpr size_t NUM_SOURCES
static std::vector< CAddress > g_sources
static void AddrManGetAddr(benchmark::Bench &bench)
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.
std::vector< CAddress > GetAddr(size_t max_addresses, size_t max_pct, std::optional< Network > network) const
Return all or many randomly selected addresses, optionally by network.
std::pair< CAddress, NodeSeconds > Select(bool newOnly=false) const
Choose an address to connect to.
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.
A combination of a network address (CNetAddr) and a (TCP) port.
std::vector< uint8_t > randbytes(size_t len)
Generate random bytes.
Main entry point to nanobench's benchmarking facility.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...