From 507d793ddefa51c62d72be542769cd066734bcc4 Mon Sep 17 00:00:00 2001 From: andig Date: Wed, 26 Feb 2025 16:25:19 +0100 Subject: [PATCH] chore: minor --- core/circuit/circuit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/circuit/circuit.go b/core/circuit/circuit.go index 83dc5f4f6..4741982d4 100644 --- a/core/circuit/circuit.go +++ b/core/circuit/circuit.go @@ -340,7 +340,7 @@ func (c *Circuit) ValidateCurrent(old, new float64) float64 { if maxCurrent := c.GetMaxCurrent(); maxCurrent != 0 { delta := max(0, new-old) potential := maxCurrent - c.current - + if delta > potential { capped := max(0, old+potential) c.log.DEBUG.Printf("validate current: %.3gA + (%.3gA -> %.3gA) > %.3gA capped at %.3gA", c.current, old, new, maxCurrent, capped)