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>
Steven Allen committed
Oct 25, 2018 at 09:15 UTC
a561eca7eca1c9c9727bc83db7c4d383c52ad303
1 file changed
+1
-7
core/commands/swarm.go
+1
-7
@@ -6,7 +6,6 @@ import (
6
"io"
7
"path"
8
"sort"
9
- "strings"
9
10
"github.com/ipfs/go-ipfs/commands"
11
"github.com/ipfs/go-ipfs/core/commands/cmdenv"
@@ -138,12 +137,7 @@ var swarmPeersCmd = &cmds.Command{
137
138
pipfs := ma.ProtocolWithCode(ma.P_IPFS).Name
139
for _, info := range ci.Peers {
141
- ids := fmt.Sprintf("/%s/%s", pipfs, info.Peer)
142
- if strings.HasSuffix(info.Addr, ids) {
143
- fmt.Fprintf(w, "%s", info.Addr)
144
- } else {
145
- fmt.Fprintf(w, "%s%s", info.Addr, ids)
146
- }
140
+ fmt.Fprintf(w, "%s/%s/%s", info.Addr, pipfs, info.Peer)
141
if info.Latency != "" {
142
fmt.Fprintf(w, " %s", info.Latency)
143
}