slow down penalty box progression and limit at 10min.

This commit is contained in:
fiatjaf
2026-06-07 22:46:19 -03:00
parent 245a47bc03
commit 7bfb4828ce
+1 -1
View File
@@ -159,7 +159,7 @@ func (pool *Pool) EnsureRelay(url string) (*Relay, error) {
if pool.penaltyBox != nil {
// putting relay in penalty box
pool.penaltyBox.Compute(nm, func(v [2]float64, loaded bool) (newV [2]float64, delete bool) {
return [2]float64{v[0] + 1, 30.0 + math.Pow(2, v[0]+1)}, false
return [2]float64{v[0] + 1, math.Min(600.0, 30.0*math.Pow(1.5, v[0]+1))}, false
})
pool.Relays.Store(nm, nil) // this is important for penalty box detection on EnsureRelay
}