Skip to content

Commit

Permalink
chore(daemon): sort listeners (#10480)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Aug 19, 2024
1 parent 0d42831 commit 34008b6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/ipfs/kubo/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,17 @@ func printLibp2pPorts(node *core.IpfsNode) {
addrMap[host][protocol] = struct{}{}
}
}
for host, protocolsSet := range addrMap {

// Produce a sorted host:port list
hosts := make([]string, 0, len(addrMap))
for host := range addrMap {
hosts = append(hosts, host)
}
sort.Strings(hosts)

// Print listeners
for _, host := range hosts {
protocolsSet := addrMap[host]
protocols := make([]string, 0, len(protocolsSet))
for protocol := range protocolsSet {
protocols = append(protocols, protocol)
Expand Down

0 comments on commit 34008b6

Please sign in to comment.