From 140e66ac644689c2aedc04b7f9a93f902a52112f Mon Sep 17 00:00:00 2001 From: Virgil Date: Sat, 4 Apr 2026 16:07:57 +0000 Subject: [PATCH] chore(proxy): sort miners deterministically Co-Authored-By: Virgil --- proxy_runtime.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proxy_runtime.go b/proxy_runtime.go index 5ef9b5d..d34b5b1 100644 --- a/proxy_runtime.go +++ b/proxy_runtime.go @@ -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 }