mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-29 07:07:16 +00:00
21 lines
440 B
Go
21 lines
440 B
Go
|
package remote
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
func (x *NodesInfoReply) Len() int {
|
||
|
return len(x.NodesInfo)
|
||
|
}
|
||
|
|
||
|
func (x *NodesInfoReply) Less(i, j int) bool {
|
||
|
if cmp := strings.Compare(x.NodesInfo[i].Name, x.NodesInfo[j].Name); cmp != 0 {
|
||
|
return cmp == -1
|
||
|
}
|
||
|
return strings.Compare(x.NodesInfo[i].Enode, x.NodesInfo[j].Enode) == -1
|
||
|
}
|
||
|
|
||
|
func (x *NodesInfoReply) Swap(i, j int) {
|
||
|
x.NodesInfo[i], x.NodesInfo[j] = x.NodesInfo[j], x.NodesInfo[i]
|
||
|
}
|