Skip to content

Commit

Permalink
use libp2p.getPeers
Browse files Browse the repository at this point in the history
  • Loading branch information
weboko committed Oct 3, 2024
1 parent 3dda8ad commit 06498f8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/sdk/src/protocols/light_push/light_push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ class LightPush extends BaseProtocolSDK implements ILightPush {
}

private async getConnectedPeers(): Promise<Peer[]> {
const peerIDs = this.libp2p
.getConnections()
.filter((c) => c.status === "open")
.sort((left, right) => right.timeline.open - left.timeline.open)
.map((c) => c.remotePeer);
const peerIDs = this.libp2p.getPeers();

if (peerIDs.length === 0) {
return [];
Expand Down

0 comments on commit 06498f8

Please sign in to comment.