@@ -911,11 +911,11 @@ static bool AttemptToEvictConnection(bool fPreferNewConnection) {
911
911
uint64_t naMostConnections;
912
912
unsigned int nMostConnections = 0 ;
913
913
int64_t nMostConnectionsTime = 0 ;
914
- std::map<uint64_t , std::vector<NodeEvictionCandidate> > mapAddrCounts ;
914
+ std::map<uint64_t , std::vector<NodeEvictionCandidate> > mapNetGroupNodes ;
915
915
BOOST_FOREACH (const NodeEvictionCandidate &node, vEvictionCandidates) {
916
- mapAddrCounts [node.nKeyedNetGroup ].push_back (node);
917
- int64_t grouptime = mapAddrCounts [node.nKeyedNetGroup ][0 ].nTimeConnected ;
918
- size_t groupsize = mapAddrCounts [node.nKeyedNetGroup ].size ();
916
+ mapNetGroupNodes [node.nKeyedNetGroup ].push_back (node);
917
+ int64_t grouptime = mapNetGroupNodes [node.nKeyedNetGroup ][0 ].nTimeConnected ;
918
+ size_t groupsize = mapNetGroupNodes [node.nKeyedNetGroup ].size ();
919
919
920
920
if (groupsize > nMostConnections || (groupsize == nMostConnections && grouptime > nMostConnectionsTime)) {
921
921
nMostConnections = groupsize;
@@ -925,7 +925,7 @@ static bool AttemptToEvictConnection(bool fPreferNewConnection) {
925
925
}
926
926
927
927
// Reduce to the network group with the most connections
928
- vEvictionCandidates = std::move (mapAddrCounts [naMostConnections]);
928
+ vEvictionCandidates = std::move (mapNetGroupNodes [naMostConnections]);
929
929
930
930
// Do not disconnect peers if there is only one unprotected connection from their network group.
931
931
// This step excessively favors netgroup diversity, and should be removed once more protective criteria are established.
0 commit comments