erigon-pulse/gointerfaces/remote/sort.go

15 lines
280 B
Go
Raw Normal View History

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