Skip to content

Commit b132ffe

Browse files
minor improvements
1 parent 51c91cd commit b132ffe

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/core/src/lib/keep_alive_manager.ts

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export class KeepAliveManager {
3737

3838
if (pingPeriodSecs !== 0) {
3939
const interval = setInterval(() => {
40+
// ping the peer for keep alive
41+
// also update the peer store with the latency
4042
libp2pPing
4143
.ping(peerId)
4244
.then((ping) => {

packages/utils/src/libp2p/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function selectRandomPeer(peers: Peer[]): Peer | undefined {
2020

2121
/**
2222
* Returns the peer with the lowest latency.
23-
* @param getPing - A function that returns the latency for a given peer
23+
* @param peerStore - The Libp2p PeerStore
2424
* @param peers - The list of peers to choose from
2525
* @returns The peer with the lowest latency, or undefined if no peer could be reached
2626
*/

0 commit comments

Comments
 (0)