Skip to content

Commit 6d6b1f7

Browse files
committed
fix: use getPeerId to determine if the ipfs fragment is missing
1 parent 12174eb commit 6d6b1f7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const Swarm = require('libp2p-swarm')
1212
const PeerId = require('peer-id')
1313
const PeerInfo = require('peer-info')
1414
const PeerBook = require('peer-book')
15-
const mafmt = require('mafmt')
1615
const multiaddr = require('multiaddr')
1716

1817
exports = module.exports
@@ -158,7 +157,7 @@ class Node extends EventEmitter {
158157
const maOld = []
159158
const maNew = []
160159
this.peerInfo.multiaddrs.forEach((ma) => {
161-
if (!mafmt.IPFS.matches(ma)) {
160+
if (!ma.getPeerId()) {
162161
maOld.push(ma)
163162
maNew.push(ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String()))
164163
}

0 commit comments

Comments
 (0)