Stable net peers output

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2019-12-11 21:45:19 +01:00
parent f16cc0322e
commit 9fa46dbac3
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -2,6 +2,8 @@ package cli
import (
"fmt"
"sort"
"strings"
"gopkg.in/urfave/cli.v2"
@ -34,6 +36,10 @@ var netPeers = &cli.Command{
return err
}
sort.Slice(peers, func(i, j int) bool {
return strings.Compare(string(peers[i].ID), string(peers[j].ID)) > 0
})
for _, peer := range peers {
fmt.Println(peer)
}