mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 18:42:19 +00:00
5654ba07c9
Closes #8078 This change is primarily intended to support go 1.21, but as a side-effect requires updating libp2p, which in turn triggers an update of golang.org/x/exp which creates quite a bit of (simple) churn in the slice sorting. This change introduces a new `cmp.Compare` function which can be used to return an integer satisfying the compare interface for slice sorting. In order to continue to support mplex for libp2p, the change references github.com/libp2p/go-libp2p-mplex instead. Please see the PR at https://github.com/libp2p/go-libp2p/pull/2498 for the official usptream comment that indicates official support for mplex being moved to this location. Co-authored-by: Jason Yellick <jason@enya.ai>
15 lines
266 B
Go
15 lines
266 B
Go
package remote
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/ledgerwatch/erigon-lib/gointerfaces/types"
|
|
)
|
|
|
|
func NodeInfoReplyCmp(i, j *types.NodeInfoReply) int {
|
|
if cmp := strings.Compare(i.Name, j.Name); cmp != 0 {
|
|
return cmp
|
|
}
|
|
return strings.Compare(i.Enode, j.Enode)
|
|
}
|