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

Method AddedNodesContain

src/net.cpp:3835–3844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3833}
3834
3835bool CConnman::AddedNodesContain(const CAddress& addr) const
3836{
3837 AssertLockNotHeld(m_added_nodes_mutex);
3838 const std::string addr_str{addr.ToStringAddr()};
3839 const std::string addr_port_str{addr.ToStringAddrPort()};
3840 LOCK(m_added_nodes_mutex);
3841 return (m_added_node_params.size() < 24 // bound the query to a reasonable limit
3842 && std::any_of(m_added_node_params.cbegin(), m_added_node_params.cend(),
3843 [&](const auto& p) { return p.m_added_node == addr_str || p.m_added_node == addr_port_str; }));
3844}
3845
3846size_t CConnman::GetNodeCount(ConnectionDirection flags) const
3847{

Callers 1

BOOST_FIXTURE_TEST_CASEFunction · 0.80

Calls 6

any_ofClass · 0.85
ToStringAddrMethod · 0.80
ToStringAddrPortMethod · 0.80
sizeMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by 1

BOOST_FIXTURE_TEST_CASEFunction · 0.64