feat: relay filtering

* feat: filter IPFS addrs correctly

* feat: mafmt addrs now support /ipfs no need for ad-hoc filtering

* feat: skip p2p-circuit addresses
This commit is contained in:
Dmitriy Ryajov
2017-10-13 08:13:28 -07:00
committed by David Dias
parent 7572279838
commit 11c4f451f4
3 changed files with 13 additions and 2 deletions

View File

@ -67,10 +67,16 @@ class TCP {
if (!Array.isArray(multiaddrs)) {
multiaddrs = [multiaddrs]
}
return multiaddrs.filter((ma) => {
if (includes(ma.protoNames(), 'p2p-circuit')) {
return false
}
if (includes(ma.protoNames(), 'ipfs')) {
ma = ma.decapsulate('ipfs')
}
return mafmt.TCP.matches(ma)
})
}