Skip to content

Commit 85886c9

Browse files
pstratemFuzzbawls
authored andcommitted
Better support for nodes with non-standard nMaxConnections
1 parent 9c9e55b commit 85886c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ static bool AttemptToEvictConnection(bool fPreferNewConnection) {
976976
// Protect the 64 nodes which have been connected the longest.
977977
// This replicates the existing implicit behavior.
978978
std::sort(vEvictionCandidates.begin(), vEvictionCandidates.end(), ReverseCompareNodeTimeConnected);
979-
vEvictionCandidates.erase(vEvictionCandidates.end() - std::min(64, static_cast<int>(vEvictionCandidates.size())), vEvictionCandidates.end());
979+
vEvictionCandidates.erase(vEvictionCandidates.end() - std::min(static_cast<int>(vEvictionCandidates.size() / 2), static_cast<int>(vEvictionCandidates.size())), vEvictionCandidates.end());
980980

981981
if (vEvictionCandidates.empty())
982982
return false;

0 commit comments

Comments
 (0)