Skip to content

Commit 34c0e5c

Browse files
committed
fix: sort addresses returned by ipfs id
1 parent d6b9436 commit 34c0e5c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/commands/id.go

+2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func printPeer(ps pstore.Peerstore, p peer.ID) (interface{}, error) {
168168
for _, a := range addrs {
169169
info.Addresses = append(info.Addresses, a.String())
170170
}
171+
sort.Strings(info.Addresses)
171172

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

0 commit comments

Comments
 (0)