chore(proxy): sort miners deterministically
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
b1af2e0081
commit
140e66ac64
1 changed files with 10 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"crypto/tls"
|
||||
"errors"
|
||||
"net"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
@ -280,6 +281,15 @@ func (p *Proxy) Miners() []*Miner {
|
|||
for _, miner := range p.miners {
|
||||
miners = append(miners, miner)
|
||||
}
|
||||
sort.Slice(miners, func(left int, right int) bool {
|
||||
if miners[left] == nil {
|
||||
return false
|
||||
}
|
||||
if miners[right] == nil {
|
||||
return true
|
||||
}
|
||||
return miners[left].ID() < miners[right].ID()
|
||||
})
|
||||
return miners
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue