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 80754fd commit d5eaa72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/ts/common/MoneroConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,9 @@ export default class MoneroConnectionManager {
// use best response if different priority (assumes being called in descending priority)
if (this.comparePriorities(bestResponse.getPriority(), bestConnection.getPriority()) !== 0) return bestResponse;

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

// check if connection is consistently better
for (let connection of responses) {
if (connection === bestConnection) continue;
Expand Down

0 comments on commit d5eaa72

Please sign in to comment.