@@ -1829,21 +1829,27 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
1829
1829
int nOutboundFullRelay = 0 ;
1830
1830
int nOutboundBlockRelay = 0 ;
1831
1831
std::set<std::vector<unsigned char > > setConnected;
1832
+
1832
1833
{
1833
1834
LOCK (cs_vNodes);
1834
1835
for (const CNode* pnode : vNodes) {
1835
- if (!pnode->IsInboundConn () && (pnode->m_conn_type != ConnectionType::MANUAL)) {
1836
- // Netgroups for inbound and addnode peers are not excluded because our goal here
1837
- // is to not use multiple of our limited outbound slots on a single netgroup
1838
- // but inbound and addnode peers do not use our outbound slots. Inbound peers
1839
- // also have the added issue that they're attacker controlled and could be used
1840
- // to prevent us from connecting to particular hosts if we used them here.
1841
- setConnected.insert (pnode->addr .GetGroup (addrman.m_asmap ));
1842
- if (pnode->m_tx_relay == nullptr ) {
1843
- nOutboundBlockRelay++;
1844
- } else if (pnode->m_conn_type == ConnectionType::OUTBOUND) {
1845
- nOutboundFullRelay++;
1846
- }
1836
+ if (pnode->IsFullOutboundConn ()) nOutboundFullRelay++;
1837
+ if (pnode->IsBlockOnlyConn ()) nOutboundBlockRelay++;
1838
+
1839
+ // Netgroups for inbound and manual peers are not excluded because our goal here
1840
+ // is to not use multiple of our limited outbound slots on a single netgroup
1841
+ // but inbound and manual peers do not use our outbound slots. Inbound peers
1842
+ // also have the added issue that they could be attacker controlled and used
1843
+ // to prevent us from connecting to particular hosts if we used them here.
1844
+ switch (pnode->m_conn_type ){
1845
+ case ConnectionType::INBOUND:
1846
+ case ConnectionType::MANUAL:
1847
+ break ;
1848
+ case ConnectionType::OUTBOUND:
1849
+ case ConnectionType::BLOCK_RELAY:
1850
+ case ConnectionType::ADDR_FETCH:
1851
+ case ConnectionType::FEELER:
1852
+ setConnected.insert (pnode->addr .GetGroup (addrman.m_asmap ));
1847
1853
}
1848
1854
}
1849
1855
}
0 commit comments