Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 4ae47e6

Browse files
committed
fix: use getPeerId to determine if /ipfs fragment is required
1 parent 736b699 commit 4ae47e6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/core/components/pre-start.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const peerId = require('peer-id')
44
const PeerInfo = require('peer-info')
55
const multiaddr = require('multiaddr')
66
const waterfall = require('async/waterfall')
7-
const mafmt = require('mafmt')
87

98
/*
109
* Load stuff from Repo into memory
@@ -26,7 +25,7 @@ module.exports = function preStart (self) {
2625
config.Addresses.Swarm.forEach((addr) => {
2726
let ma = multiaddr(addr)
2827

29-
if (mafmt.IPFS.matches(ma) && !ma.protoNames().indexOf('ipfs') > -1) {
28+
if (ma.getPeerId()) {
3029
ma = ma.encapsulate('/ipfs/' + self._peerInfo.id.toB58String())
3130
}
3231

0 commit comments

Comments
 (0)