mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-05-10 09:47:13 +00:00
fix: addition of ipfs id appendix must come before transport filtering
This commit is contained in:
parent
59ea9c388f
commit
291e79fc99
16
src/index.js
16
src/index.js
@ -93,6 +93,15 @@ class Node extends EventEmitter {
|
||||
let transports = this.modules.transport
|
||||
|
||||
transports = Array.isArray(transports) ? transports : [transports]
|
||||
|
||||
// so that we can have webrtc-star addrs without adding manually the id
|
||||
this.peerInfo.multiaddrs = this.peerInfo.multiaddrs.map((ma) => {
|
||||
if (!mafmt.IPFS.matches(ma)) {
|
||||
ma = ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String())
|
||||
}
|
||||
return ma
|
||||
})
|
||||
|
||||
const multiaddrs = this.peerInfo.multiaddrs
|
||||
|
||||
transports.forEach((transport) => {
|
||||
@ -107,13 +116,6 @@ class Node extends EventEmitter {
|
||||
}
|
||||
})
|
||||
|
||||
// so that we can have webrtc-star addrs without adding manually the id
|
||||
this.peerInfo.multiaddrs = this.peerInfo.multiaddrs.map((ma) => {
|
||||
if (!mafmt.IPFS.matches(ma)) {
|
||||
ma = ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String())
|
||||
}
|
||||
})
|
||||
|
||||
this.swarm.listen((err) => {
|
||||
if (err) {
|
||||
return callback(err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user