mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-09 14:34:27 +00:00
sort by big.Int
This commit is contained in:
parent
d3fc7da872
commit
6f4bb10efd
1 changed files with 2 additions and 2 deletions
|
|
@ -1622,7 +1622,7 @@ func (bc *BlockChain) UpdateM1() error {
|
||||||
}
|
}
|
||||||
//TODO: smart contract shouldn't return "0x0000000000000000000000000000000000000000"
|
//TODO: smart contract shouldn't return "0x0000000000000000000000000000000000000000"
|
||||||
if candidate.String() != "0x0000000000000000000000000000000000000000" {
|
if candidate.String() != "0x0000000000000000000000000000000000000000" {
|
||||||
ms = append(ms, XDPoS.Masternode{Address: candidate, Stake: v.Uint64()})
|
ms = append(ms, XDPoS.Masternode{Address: candidate, Stake: v})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(ms) == 0 {
|
if len(ms) == 0 {
|
||||||
|
|
@ -1630,7 +1630,7 @@ func (bc *BlockChain) UpdateM1() error {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
} else {
|
} else {
|
||||||
sort.Slice(ms, func(i, j int) bool {
|
sort.Slice(ms, func(i, j int) bool {
|
||||||
return ms[i].Stake >= ms[j].Stake
|
return ms[i].Stake.Cmp(ms[j].Stake) >= 0
|
||||||
})
|
})
|
||||||
log.Info("Ordered list of masternode candidates")
|
log.Info("Ordered list of masternode candidates")
|
||||||
for _, m := range ms {
|
for _, m := range ms {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue