MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / AddrManSelectByNetwork

Function AddrManSelectByNetwork

src/bench/addrman.cpp:121–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121static void AddrManSelectByNetwork(benchmark::Bench& bench)
122{
123 AddrMan addrman{EMPTY_NETGROUPMAN, /*deterministic=*/false, ADDRMAN_CONSISTENCY_CHECK_RATIO};
124
125 // add single I2P address to new table
126 CService i2p_service;
127 i2p_service.SetSpecial("udhdrtrcetjm5sxzskjyr5ztpeszydbh4dpl3pl4utgqqw2v4jna.b32.i2p");
128 CAddress i2p_address(i2p_service, NODE_NONE);
129 i2p_address.nTime = Now<NodeSeconds>();
130 const CNetAddr source{LookupHost("252.2.2.2", false).value()};
131 addrman.Add({i2p_address}, source);
132
133 FillAddrMan(addrman);
134
135 bench.run([&] {
136 (void)addrman.Select(/*new_only=*/false, {NET_I2P});
137 });
138}
139
140static void AddrManGetAddr(benchmark::Bench& bench)
141{

Callers

nothing calls this directly

Calls 7

LookupHostFunction · 0.85
FillAddrManFunction · 0.85
SetSpecialMethod · 0.80
SelectMethod · 0.80
valueMethod · 0.45
AddMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected