Browse Source

Better support for nodes with non-standard nMaxConnections

0.13
Patrick Strateman 9 years ago
parent
commit
17f3533c84
  1. 2
      src/net.cpp

2
src/net.cpp

@ -862,7 +862,7 @@ static bool AttemptToEvictConnection(bool fPreferNewConnection) {
// Protect the 64 nodes which have been connected the longest. // Protect the 64 nodes which have been connected the longest.
// This replicates the existing implicit behavior. // This replicates the existing implicit behavior.
std::sort(vEvictionCandidates.begin(), vEvictionCandidates.end(), ReverseCompareNodeTimeConnected); 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()) if (vEvictionCandidates.empty())
return false; return false;

Loading…
Cancel
Save