src/net.cpp
int CConnman::GetExtraOutboundCount()
{
    int nOutbound = 0;
    {
        LOCK(cs_vNodes);
        for (const CNode* pnode : vNodes) {
            if (!pnode->fInbound && !pnode->m_manual_connection && !pnode->fFeeler && !pnode->fDisconnect && !pnode->fOneShot && pnode->fSuccessfullyConnected) {
                ++nOutbound;
            }
        }
    }
    return std::max(nOutbound - m_max_outbound_full_relay - m_max_outbound_block_relay, 0);
}
// 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 one-shots and feelers)
// 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)
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
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)
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 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 )
int CConnman::GetExtraOutboundCount()
{
    int nOutbound = 0;
    {
        LOCK(cs_vNodes);
        for (const CNode* pnode : vNodes) {
            if (!pnode->fInbound && !pnode->m_manual_connection && !pnode->fFeeler && !pnode->fDisconnect && !pnode->fOneShot && pnode->fSuccessfullyConnected) {
                ++nOutbound;
            }
        }
    }
    return std::max(nOutbound - m_max_outbound_full_relay - m_max_outbound_block_relay, 0);
}
int CConnman :: GetExtraOutboundCount ( ) { int nOutbound = 0 ; { LOCK ( cs_vNodes ) ; for ( const CNode * pnode : vNodes ) { if ( ! pnode -> fInbound && ! pnode -> m_manual_connection && ! pnode -> fFeeler && ! pnode -> fDisconnect && ! pnode -> fOneShot && pnode -> fSuccessfullyConnected ) { ++ nOutbound ; } } } return std :: max ( nOutbound - m_max_outbound_full_relay - m_max_outbound_block_relay , 0 ) ; }
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 one-shots and feelers)
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)
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 one - shots and feelers ) 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 )