We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2996d98 commit 961b3f7Copy full SHA for 961b3f7
1 file changed
pkg/config/config.go
@@ -313,6 +313,20 @@ func (c *Config) Validate() error {
313
c.Node.LazyBlockInterval.Duration, c.Node.BlockTime.Duration)
314
}
315
316
+ // Validate pruning configuration
317
+ if c.Node.PruningEnabled {
318
+ // When pruning is enabled, pruning_interval must be >= 1
319
+ if c.Node.PruningInterval == 0 {
320
+ return fmt.Errorf("pruning_interval must be >= 1 when pruning is enabled")
321
+ }
322
+
323
+ // When pruning is enabled, keeping 0 blocks is contradictory; use pruning_enabled=false
324
+ // for archive mode instead.
325
+ if c.Node.PruningKeepRecent == 0 {
326
+ return fmt.Errorf("pruning_keep_recent must be > 0 when pruning is enabled; use pruning_enabled=false to keep all blocks")
327
328
329
330
return nil
331
332
0 commit comments