@@ -917,7 +917,7 @@ bool CConnman::AttemptToEvictConnection()
917
917
.m_is_local = node->addr .IsLocal (),
918
918
.m_network = node->ConnectedThroughNetwork (),
919
919
.m_noban = node->HasPermission (NetPermissionFlags::NoBan),
920
- .m_conn_type = node->GetConnectionType () ,
920
+ .m_conn_type = node->m_conn_type ,
921
921
};
922
922
vEvictionCandidates.push_back (candidate);
923
923
}
@@ -1092,7 +1092,7 @@ bool CConnman::AddConnection(const std::string& address, ConnectionType conn_typ
1092
1092
1093
1093
// Count existing connections
1094
1094
int existing_connections = WITH_LOCK (m_nodes_mutex,
1095
- return std::count_if (m_nodes.begin (), m_nodes.end (), [conn_type](CNode* node) { return node->GetConnectionType () == conn_type; }););
1095
+ return std::count_if (m_nodes.begin (), m_nodes.end (), [conn_type](CNode* node) { return node->m_conn_type == conn_type; }););
1096
1096
1097
1097
// Max connections of specified type already exist
1098
1098
if (max_connections != std::nullopt && existing_connections >= max_connections) return false ;
@@ -1711,7 +1711,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
1711
1711
if (pnode->IsBlockOnlyConn ()) nOutboundBlockRelay++;
1712
1712
1713
1713
// Make sure our persistent outbound slots belong to different netgroups.
1714
- switch (pnode->GetConnectionType () ) {
1714
+ switch (pnode->m_conn_type ) {
1715
1715
// We currently don't take inbound connections into account. Since they are
1716
1716
// free to make, an attacker could make them to prevent us from connecting to
1717
1717
// certain peers.
@@ -2777,9 +2777,9 @@ CNode::CNode(NodeId idIn,
2777
2777
m_inbound_onion{inbound_onion},
2778
2778
m_prefer_evict{node_opts.prefer_evict },
2779
2779
nKeyedNetGroup{nKeyedNetGroupIn},
2780
+ m_conn_type{conn_type_in},
2780
2781
id{idIn},
2781
2782
nLocalHostNonce{nLocalHostNonceIn},
2782
- m_conn_type{conn_type_in},
2783
2783
m_i2p_sam_session{std::move (node_opts.i2p_sam_session )}
2784
2784
{
2785
2785
if (inbound_onion) assert (conn_type_in == ConnectionType::INBOUND);
0 commit comments