config: default TrickleDelay to 1ms if non-positive

This commit is contained in:
Slyghtning committed 2026-02-02 20:47:59 +01:00
1 parent dd29d5690f
commit 4ef2019dd9
2 files changed
+65

No files matched your search

+9
View File
@@ -1819,6 +1819,15 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
return nil, mkErr("unable to parse node color: %v", err)
}
// Validate TrickleDelay and default to 1ms if non-positive to ensure
// the trickle timer can still function.
if cfg.TrickleDelay <= 0 {
srvrLog.Infof("TrickleDelay is non-positive (%v ms), "+
"setting to 1ms", cfg.TrickleDelay)
cfg.TrickleDelay = 1
}
// All good, return the sanitized result.
return &cfg, nil
}