mirror of
https://github.com/btcsuite/btcd.git
synced 2025-02-23 06:35:20 +01:00
main: Disable enabling both --prune and --addrindex
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.
This commit is contained in:
parent
a1736b4267
commit
57903c71c9
1 changed files with 8 additions and 0 deletions
|
@ -1155,6 +1155,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.
|
||||
|
|
Loading…
Add table
Reference in a new issue