Skip to content

Commit

Permalink
Merge pull request #2703 from OriginTrail/bugfix/bid-suggestion-update
Browse files Browse the repository at this point in the history
Bugfix/bid suggestion update
  • Loading branch information
djordjekovac authored Sep 5, 2023
2 parents 103674f + 89d2e76 commit 1653196
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/service/sharding-table-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ class ShardingTableService {
const filteredPeerRecords = peerRecords.filter((peer) => peer.peerId !== myPeerId);
const sorted = filteredPeerRecords.sort((a, b) => a.ask - b.ask);
let ask;
if (sorted.length > r1) {
ask = sorted[r1 - 1].ask;
if (sorted.length > r1 + 1) {
ask = sorted[r1].ask;
} else {
ask = sorted[sorted.length - 1].ask;
}
Expand Down

0 comments on commit 1653196

Please sign in to comment.