Skip to content

Commit

Permalink
fix: sort addresses returned by ipfs id
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Aug 9, 2020
1 parent d6b9436 commit 34c0e5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/commands/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func printPeer(ps pstore.Peerstore, p peer.ID) (interface{}, error) {
for _, a := range addrs {
info.Addresses = append(info.Addresses, a.String())
}
sort.Strings(info.Addresses)

protocols, _ := ps.GetProtocols(p) // don't care about errors here.
for _, p := range protocols {
Expand Down Expand Up @@ -209,6 +210,7 @@ func printSelf(node *core.IpfsNode) (interface{}, error) {
for _, a := range addrs {
info.Addresses = append(info.Addresses, a.String())
}
sort.Strings(info.Addresses)
info.Protocols = node.PeerHost.Mux().Protocols()
sort.Strings(info.Protocols)
}
Expand Down

0 comments on commit 34c0e5c

Please sign in to comment.