mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
23 lines
444 B
Go
23 lines
444 B
Go
package sync
|
|
|
|
import "math/big"
|
|
|
|
type PeerWithBlockNumInfo struct {
|
|
ID string
|
|
BlockNum *big.Int
|
|
}
|
|
|
|
type PeersWithBlockNumInfo []*PeerWithBlockNumInfo
|
|
|
|
func (peers PeersWithBlockNumInfo) Len() int {
|
|
return len(peers)
|
|
}
|
|
|
|
func (peers PeersWithBlockNumInfo) Less(i int, j int) bool {
|
|
return peers[i].BlockNum.Cmp(peers[j].BlockNum) < 1
|
|
}
|
|
|
|
func (peers PeersWithBlockNumInfo) Swap(i int, j int) {
|
|
peers[i], peers[j] = peers[j], peers[i]
|
|
}
|