Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

feat: skip p2p-circuit addresses #80

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class TCP {
multiaddrs = [multiaddrs]
}
return multiaddrs.filter((ma) => {
if (includes(ma.protoNames(), 'ipfs')) {
if (includes(ma.protoNames(), 'p2p-circuit')) {
return false
} else if (includes(ma.protoNames(), 'ipfs')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use mafmt for this instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do, but decapsulated will strip the ipfs part along with p2p-circuit, so mafmt wont match it. Mafmt does have all the logic to do the matches correctly tho.

ma = ma.decapsulate('ipfs')
}
return mafmt.TCP.matches(ma)
Expand Down