We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51c91cd commit b132ffeCopy full SHA for b132ffe
packages/core/src/lib/keep_alive_manager.ts
@@ -37,6 +37,8 @@ export class KeepAliveManager {
37
38
if (pingPeriodSecs !== 0) {
39
const interval = setInterval(() => {
40
+ // ping the peer for keep alive
41
+ // also update the peer store with the latency
42
libp2pPing
43
.ping(peerId)
44
.then((ping) => {
packages/utils/src/libp2p/index.ts
@@ -20,7 +20,7 @@ export function selectRandomPeer(peers: Peer[]): Peer | undefined {
20
21
/**
22
* Returns the peer with the lowest latency.
23
- * @param getPing - A function that returns the latency for a given peer
+ * @param peerStore - The Libp2p PeerStore
24
* @param peers - The list of peers to choose from
25
* @returns The peer with the lowest latency, or undefined if no peer could be reached
26
*/
0 commit comments