提交 6c63cec7 作者: vyzo

swarm: more robust logic in remote address printing

Handles p2p-circuit addresses and any other address that uses a similar
routing scheme.

License: MIT
Signed-off-by: 's avatarvyzo <vyzo@hackzen.org>
上级 98da0853
......@@ -129,7 +129,7 @@ var swarmPeersCmd = &cmds.Command{
buf := new(bytes.Buffer)
for _, info := range ci.Peers {
if strings.Contains(info.Addr, "/p2p-circuit/") {
if strings.HasSuffix(info.Addr, fmt.Sprintf("/ipfs/%s", info.Peer)) {
fmt.Fprintf(buf, "%s", info.Addr)
} else {
fmt.Fprintf(buf, "%s/ipfs/%s", info.Addr, info.Peer)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论