erigon-pulse/gointerfaces/remote/sort.go
2022-07-26 09:42:34 +07:00

15 lines
280 B
Go

package remote
import (
"strings"
"github.com/ledgerwatch/erigon-lib/gointerfaces/types"
)
func NodeInfoReplyLess(i, j *types.NodeInfoReply) bool {
if cmp := strings.Compare(i.Name, j.Name); cmp != 0 {
return cmp == -1
}
return strings.Compare(i.Enode, j.Enode) == -1
}