Skip to content

Commit

Permalink
main: Disable enabling both --prune and --addrindex
Browse files Browse the repository at this point in the history
You can have a addrindex but with the actual blocks gone, they won't be
much of a help.  Consider allowing these option to be both on in the
future where the addrindex is only indexing the non-pruned blocks.
  • Loading branch information
kcalvinalvin committed May 19, 2023
1 parent 2cc1eb1 commit b3a525f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,14 @@ func loadConfig() (*config, []string, error) {
return nil, nil, err
}

if cfg.Prune != 0 && cfg.AddrIndex {
err := fmt.Errorf("%s: the --prune and --addrindex options may "+
"not be activated at the same time", funcName)
fmt.Fprintln(os.Stderr, err)
fmt.Fprintln(os.Stderr, usageMessage)
return nil, nil, err
}

// Warn about missing config file only after all other configuration is
// done. This prevents the warning on help messages and invalid
// options. Note this should go directly before the return.
Expand Down

0 comments on commit b3a525f

Please sign in to comment.