We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0636b5 commit 6401b11Copy full SHA for 6401b11
1 file changed
pkg/config/config.go
@@ -288,6 +288,20 @@ func (c *Config) Validate() error {
288
c.Node.LazyBlockInterval.Duration, c.Node.BlockTime.Duration)
289
}
290
291
+ // Validate pruning configuration
292
+ if c.Node.PruningEnabled {
293
+ // When pruning is enabled, pruning_interval must be >= 1
294
+ if c.Node.PruningInterval == 0 {
295
+ return fmt.Errorf("pruning_interval must be >= 1 when pruning is enabled")
296
+ }
297
+
298
+ // When pruning is enabled, keeping 0 blocks is contradictory; use pruning_enabled=false
299
+ // for archive mode instead.
300
+ if c.Node.PruningKeepRecent == 0 {
301
+ return fmt.Errorf("pruning_keep_recent must be > 0 when pruning is enabled; use pruning_enabled=false to keep all blocks")
302
303
304
305
return nil
306
307
0 commit comments