Skip to content
This repository was archived by the owner on Aug 23, 2019. It is now read-only.

Commit fe062a4

Browse files
committed
fix: tests and conflicts
1 parent 87b51a9 commit fe062a4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/dial.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -256,23 +256,24 @@ class Dialer {
256256

257257
const tKeys = this.switch.availableTransports(this.peerInfo)
258258

259-
const circuitEnabled = Boolean(swtch.transports[Circuit.tag])
259+
const circuitEnabled = Boolean(this.switch.transports[Circuit.tag])
260260
let circuitTried = false
261261

262262
const nextTransport = (key) => {
263263
let transport = key
264+
const b58Id = this.peerInfo.id.toB58String()
264265
if (!transport) {
265266
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))
268269
}
269270

270271
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}!`))
272273
}
273274

274275
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}`)
276277
circuitTried = true
277278
transport = Circuit.tag
278279
}

0 commit comments

Comments
 (0)