Skip to content

Commit

Permalink
fix: extract peerIds from Multiaddrs for pendingDials function (libp2…
Browse files Browse the repository at this point in the history
  • Loading branch information
maschad committed Feb 15, 2023
1 parent 6a2b8b9 commit cfbbcad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/connection-manager/dialer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ export class DefaultDialer implements Startable, Dialer {
* Returns true if the peer id is in the pending dials
*/
hasPendingDial (peerId: PeerId | Multiaddr): boolean {
if (isMultiaddr(peerId)) {
return this.pendingDials.has(peerId.getPeerId() ?? '')
}

return this.pendingDials.has(peerId.toString())
}

Expand Down

0 comments on commit cfbbcad

Please sign in to comment.