This repository was archived by the owner on Aug 23, 2019. It is now read-only.
File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -256,23 +256,24 @@ class Dialer {
256
256
257
257
const tKeys = this . switch . availableTransports ( this . peerInfo )
258
258
259
- const circuitEnabled = Boolean ( swtch . transports [ Circuit . tag ] )
259
+ const circuitEnabled = Boolean ( this . switch . transports [ Circuit . tag ] )
260
260
let circuitTried = false
261
261
262
262
const nextTransport = ( key ) => {
263
263
let transport = key
264
+ const b58Id = this . peerInfo . id . toB58String ( )
264
265
if ( ! transport ) {
265
266
if ( ! circuitEnabled ) {
266
- const msg = `Circuit not enabled and all transports failed to dial peer ${ pi . id . toB58String ( ) } !`
267
- return cb ( new Error ( msg ) )
267
+ const msg = `Circuit not enabled and all transports failed to dial peer ${ b58Id } !`
268
+ return callback ( new Error ( msg ) )
268
269
}
269
270
270
271
if ( circuitTried ) {
271
- return cb ( new Error ( `No available transports to dial peer ${ pi . id . toB58String ( ) } !` ) )
272
+ return callback ( new Error ( `No available transports to dial peer ${ b58Id } !` ) )
272
273
}
273
274
274
275
log ( `Falling back to dialing over circuit` )
275
- this . peerInfo . multiaddrs . add ( `/p2p-circuit/ipfs/${ this . peerInfo . id . toB58String ( ) } ` )
276
+ this . peerInfo . multiaddrs . add ( `/p2p-circuit/ipfs/${ b58Id } ` )
276
277
circuitTried = true
277
278
transport = Circuit . tag
278
279
}
You can’t perform that action at this time.
0 commit comments