mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 04:47:45 +08:00
remove p2p-circuit addr hack in ipfs swarm peers
We used to have to do this as these addresses had `/ipfs/QmId` appended at the *transport* layer. However, we were able to remove this with the transport refactor so we can now remove this check. fixes https://github.com/libp2p/specs/issues/72 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
parent
7ecd6756b4
commit
a561eca7ec
@ -6,7 +6,6 @@ import (
|
||||
"io"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/ipfs/go-ipfs/commands"
|
||||
"github.com/ipfs/go-ipfs/core/commands/cmdenv"
|
||||
@ -138,12 +137,7 @@ var swarmPeersCmd = &cmds.Command{
|
||||
|
||||
pipfs := ma.ProtocolWithCode(ma.P_IPFS).Name
|
||||
for _, info := range ci.Peers {
|
||||
ids := fmt.Sprintf("/%s/%s", pipfs, info.Peer)
|
||||
if strings.HasSuffix(info.Addr, ids) {
|
||||
fmt.Fprintf(w, "%s", info.Addr)
|
||||
} else {
|
||||
fmt.Fprintf(w, "%s%s", info.Addr, ids)
|
||||
}
|
||||
fmt.Fprintf(w, "%s/%s/%s", info.Addr, pipfs, info.Peer)
|
||||
if info.Latency != "" {
|
||||
fmt.Fprintf(w, " %s", info.Latency)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user