Skip to content

Commit 0e46824

Browse files
use the new API for selectPeerForProtocol
1 parent 6a07f45 commit 0e46824

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/lib/base_protocol.ts

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { IBaseProtocol, Libp2pComponents } from "@waku/interfaces";
66
import { getPeersForProtocol, selectPeerForProtocol } from "@waku/utils/libp2p";
77

88
import { filterPeers } from "./filterPeers.js";
9+
import { KeepAliveManager } from "./keep_alive_manager.js";
910
import { StreamManager } from "./stream_manager.js";
1011

1112
/**
@@ -54,8 +55,10 @@ export class BaseProtocol implements IBaseProtocol {
5455
}
5556

5657
protected async getPeer(peerId?: PeerId): Promise<Peer> {
58+
const { peerPings } = KeepAliveManager.getInstance();
5759
const { peer } = await selectPeerForProtocol(
5860
this.peerStore,
61+
peerPings,
5962
[this.multicodec],
6063
peerId
6164
);

0 commit comments

Comments
 (0)