MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetExtraFullOutboundCount

Method GetExtraFullOutboundCount

src/net.cpp:1891–1903  ·  view source on GitHub ↗

Return the number of peers we have over our outbound connection limit Exclude peers that are marked for disconnect, or are going to be disconnected soon (eg ADDR_FETCH and FEELER) Also exclude peers that haven't finished initial connection handshake yet (so that we don't decide we're over our desired connection limit, and then evict some peer that has finished the handshake)

Source from the content-addressed store, hash-verified

1889// (so that we don't decide we're over our desired connection limit, and then
1890// evict some peer that has finished the handshake)
1891int CConnman::GetExtraFullOutboundCount() const
1892{
1893 int full_outbound_peers = 0;
1894 {
1895 LOCK(m_nodes_mutex);
1896 for (const CNode* pnode : m_nodes) {
1897 if (pnode->fSuccessfullyConnected && !pnode->fDisconnect && pnode->IsFullOutboundConn()) {
1898 ++full_outbound_peers;
1899 }
1900 }
1901 }
1902 return std::max(full_outbound_peers - m_max_outbound_full_relay, 0);
1903}
1904
1905int CConnman::GetExtraBlockRelayCount() const
1906{

Callers 2

FUZZ_TARGET_INITFunction · 0.80

Calls 1

IsFullOutboundConnMethod · 0.80

Tested by 1

FUZZ_TARGET_INITFunction · 0.64