Commit d6b94360 authored by Adin Schmahmann's avatar Adin Schmahmann

fix: sort protocols returned by ipfs id

parent dd47364e
......@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"sort"
"strings"
version "github.com/ipfs/go-ipfs"
......@@ -172,6 +173,7 @@ func printPeer(ps pstore.Peerstore, p peer.ID) (interface{}, error) {
for _, p := range protocols {
info.Protocols = append(info.Protocols, string(p))
}
sort.Strings(info.Protocols)
if v, err := ps.Get(p, "ProtocolVersion"); err == nil {
if vs, ok := v.(string); ok {
......@@ -208,6 +210,7 @@ func printSelf(node *core.IpfsNode) (interface{}, error) {
info.Addresses = append(info.Addresses, a.String())
}
info.Protocols = node.PeerHost.Mux().Protocols()
sort.Strings(info.Protocols)
}
info.ProtocolVersion = identify.LibP2PVersion
info.AgentVersion = version.UserAgent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment