File tree 1 file changed +5
-0
lines changed
src/connection-manager/dialer
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import type { AddressSorter, PeerStore } from '@libp2p/interface-peer-store'
23
23
import type { Metrics } from '@libp2p/interface-metrics'
24
24
import type { Dialer } from '@libp2p/interface-connection-manager'
25
25
import type { TransportManager } from '@libp2p/interface-transport'
26
+ import { peerIdFromString } from '@libp2p/peer-id'
26
27
27
28
const log = logger ( 'libp2p:dialer' )
28
29
@@ -228,6 +229,10 @@ export class DefaultDialer implements Startable, Dialer {
228
229
* Returns true if the peer id is in the pending dials
229
230
*/
230
231
hasPendingDial ( peerId : PeerId | Multiaddr ) : boolean {
232
+ if ( isMultiaddr ( peerId ) ) {
233
+ return this . pendingDials . has ( peerId . getPeerId ( ) ?? '' )
234
+ }
235
+
231
236
return this . pendingDials . has ( peerId . toString ( ) )
232
237
}
233
238
You can’t perform that action at this time.
0 commit comments