mirror of https://github.com/waku-org/js-waku.git
feat: only dial a peer if it has a wss multiaddr
This commit is contained in:
parent
73d78aa0ad
commit
0ffce07924
|
@ -456,6 +456,17 @@ export class ConnectionManager
|
|||
return false;
|
||||
}
|
||||
|
||||
const peer = await this.libp2p.peerStore.get(peerId);
|
||||
|
||||
if (
|
||||
!peer.addresses.some((val) => val.multiaddr.toString().includes("/wss/"))
|
||||
) {
|
||||
log.info(
|
||||
`Peer ${peerId.toString()} does not have a multiaddr that supports wss, not dialing.`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
// if the peer is not part of any of the configured pubsub topics, don't dial
|
||||
if (!(await this.isPeerTopicConfigured(peerId))) {
|
||||
const shardInfo = await this.getPeerShardInfo(
|
||||
|
|
Loading…
Reference in New Issue