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

fix: multiaddr validation to add peer id for listening #2833

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/ipfs/src/core/components/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ module.exports = ({
config.Addresses.Swarm.forEach(addr => {
let ma = multiaddr(addr)

if (ma.getPeerId()) {
// multiaddrs that go via a signalling server or other intermediary (e.g. stardust,
// webrtc-star) can have the intermediary's peer ID in the address, so append our
// peer ID to the end of it
const maId = ma.getPeerId()
achingbrain marked this conversation as resolved.
Show resolved Hide resolved
if (maId && maId !== peerInfo.id.toB58String()) {
ma = ma.encapsulate(`/p2p/${peerInfo.id.toB58String()}`)
}

Expand Down