Skip to content

Commit

Permalink
keep best connection if not enough data
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Apr 23, 2024
1 parent 3cb80cb commit bfa0922
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/monero/common/MoneroConnectionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,9 @@ private MoneroRpcConnection getBestConnectionFromPrioritizedResponses(Collection

// use best response if different priority (assumes being called in descending priority)
if (priorityComparator.compare(bestResponse.getPriority(), bestConnection.getPriority()) != 0) return bestResponse;

// keep best connection if not enough data
if (!responseTimes.containsKey(bestConnection)) return bestConnection;

// check if a connection is consistently better
for (MoneroRpcConnection connection : responses) {
Expand Down

0 comments on commit bfa0922

Please sign in to comment.