diff options
| author | Patrick Strateman <[email protected]> | 2015-08-21 18:42:05 -0700 |
|---|---|---|
| committer | Patrick Strateman <[email protected]> | 2015-08-22 15:38:24 -0700 |
| commit | 17f3533c8484f02732fff5cf004d251c0df50eb8 (patch) | |
| tree | 880b188bf54056f929bbd1066dde6bbff91015c5 /src/net.cpp | |
| parent | RAII wrapper for CNode* (diff) | |
| download | discoin-17f3533c8484f02732fff5cf004d251c0df50eb8.tar.xz discoin-17f3533c8484f02732fff5cf004d251c0df50eb8.zip | |
Better support for nodes with non-standard nMaxConnections
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 709c65243..4d08f63e3 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; |