mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
Merge pull request #5645 from ipfs/fix/remove-p2p-circuit-swarm-hack
remove p2p-circuit addr hack in ipfs swarm peers
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"path"
|
"path"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/ipfs/go-ipfs/commands"
|
"github.com/ipfs/go-ipfs/commands"
|
||||||
"github.com/ipfs/go-ipfs/core/commands/cmdenv"
|
"github.com/ipfs/go-ipfs/core/commands/cmdenv"
|
||||||
@ -138,12 +137,7 @@ var swarmPeersCmd = &cmds.Command{
|
|||||||
|
|
||||||
pipfs := ma.ProtocolWithCode(ma.P_IPFS).Name
|
pipfs := ma.ProtocolWithCode(ma.P_IPFS).Name
|
||||||
for _, info := range ci.Peers {
|
for _, info := range ci.Peers {
|
||||||
ids := fmt.Sprintf("/%s/%s", pipfs, info.Peer)
|
fmt.Fprintf(w, "%s/%s/%s", info.Addr, pipfs, info.Peer)
|
||||||
if strings.HasSuffix(info.Addr, ids) {
|
|
||||||
fmt.Fprintf(w, "%s", info.Addr)
|
|
||||||
} else {
|
|
||||||
fmt.Fprintf(w, "%s%s", info.Addr, ids)
|
|
||||||
}
|
|
||||||
if info.Latency != "" {
|
if info.Latency != "" {
|
||||||
fmt.Fprintf(w, " %s", info.Latency)
|
fmt.Fprintf(w, " %s", info.Latency)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user