@cryptotaxi247 / kubo / commits / 31e3b8f80

simplify code for ipfs protocol scheme in multiaddr display

License: MIT Signed-off-by: vyzo <vyzo@hackzen.org>

vyzo committed Aug 2, 2017 at 12:04 UTC 31e3b8f8050e53438b20a41c0a08f5e2263801f1
1 file changed +2 -2
core/commands/swarm.go
+2 -2
@@ -128,9 +128,9 @@ var swarmPeersCmd = &cmds.Command{
128 }
129
130 buf := new(bytes.Buffer)
131 - pipfs := ma.ProtocolWithCode(ma.P_IPFS)
131 + pipfs := ma.ProtocolWithCode(ma.P_IPFS).Name
132 for _, info := range ci.Peers {
133 - ids := fmt.Sprintf("/%s/%s", pipfs.Name, info.Peer)
133 + ids := fmt.Sprintf("/%s/%s", pipfs, info.Peer)
134 if strings.HasSuffix(info.Addr, ids) {
135 fmt.Fprintf(buf, "%s", info.Addr)
136 } else {