Fixed relay selection - deterministic w/ fallback.

This commit is contained in:
jdl
2026-06-18 06:41:55 +02:00
parent 8aafcab57f
commit da2115584c
2 changed files with 25 additions and 11 deletions

View File

@@ -61,8 +61,10 @@ func (a *App) onStateTick() {
}
}
// Ensure we have a live relay (if we're not public).
if !a.isPublic && (a.relay == nil || !a.relay.Up()) {
// Keep the active relay pinned to the lowest-IP live relay (if we're not
// public). switchActiveRelay is idempotent and handles failover when the
// current relay dies as well as failback when a lower-IP relay recovers.
if !a.isPublic {
a.switchActiveRelay()
}
}