github.com/ledgerwatch/erigon-lib@v1.0.0/gointerfaces/remote/sort.go (about)

     1  package remote
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/ledgerwatch/erigon-lib/gointerfaces/types"
     7  )
     8  
     9  func NodeInfoReplyLess(i, j *types.NodeInfoReply) bool {
    10  	if cmp := strings.Compare(i.Name, j.Name); cmp != 0 {
    11  		return cmp == -1
    12  	}
    13  	return strings.Compare(i.Enode, j.Enode) == -1
    14  }