Skip to content

Commit

Permalink
main: Disable enabling both --prune and --txindex
Browse files Browse the repository at this point in the history
You can have a txindex 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 txindex is only indexing the non-pruned blocks.
  • Loading branch information
kcalvinalvin committed Jul 21, 2023
1 parent ec013b7 commit c6e0b95
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 @@ -1147,6 +1147,14 @@ func loadConfig() (*config, []string, error) {
return nil, nil, err
}

if cfg.Prune != 0 && cfg.TxIndex {
err := fmt.Errorf("%s: the --prune and --txindex 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 c6e0b95

Please sign in to comment.