mirror of https://github.com/waku-org/js-waku.git
Merge pull request #303 from status-im/heartbeat
Fix hearbeat tick handler rounding issue
This commit is contained in:
commit
0482239e8b
|
@ -276,7 +276,7 @@ export class RelayHeartbeat extends Heartbeat {
|
|||
const peersList = Array.from(peers).sort(
|
||||
(a, b) => getScore(a) - getScore(b)
|
||||
);
|
||||
const medianIndex = peers.size / 2;
|
||||
const medianIndex = Math.floor(peers.size / 2);
|
||||
const medianScore = getScore(peersList[medianIndex]);
|
||||
|
||||
// if the median score is below the threshold, select a better peer (if any) and GRAFT
|
||||
|
|
Loading…
Reference in New Issue