aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 709c652430..4d08f63e32 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -862,7 +862,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;