]> Git Repo - VerusCoin.git/commitdiff
Better support for nodes with non-standard nMaxConnections
authorPatrick Strateman <[email protected]>
Sat, 22 Aug 2015 01:42:05 +0000 (18:42 -0700)
committerTaylor Hornby <[email protected]>
Tue, 16 Aug 2016 01:38:04 +0000 (19:38 -0600)
src/net.cpp

index c726f37149eb3a6be84d025d114e62c1b5d899de..cbc15fffaa3277805978639330438a12b2fa6078 100644 (file)
@@ -758,7 +758,7 @@ static bool AttemptToEvictConnection(bool fPreferNewConnection) {
     // Protect the 64 nodes which have been connected the longest.
     // This replicates the existing implicit behavior.
     std::sort(vEvictionCandidates.begin(), vEvictionCandidates.end(), ReverseCompareNodeTimeConnected);
-    vEvictionCandidates.erase(vEvictionCandidates.end() - std::min(64, static_cast<int>(vEvictionCandidates.size())), vEvictionCandidates.end());
+    vEvictionCandidates.erase(vEvictionCandidates.end() - std::min(static_cast<int>(vEvictionCandidates.size() / 2), static_cast<int>(vEvictionCandidates.size())), vEvictionCandidates.end());
 
     if (vEvictionCandidates.empty())
         return false;
This page took 0.029959 seconds and 4 git commands to generate.