diff --git a/config.go b/config.go index a162c47da5d..bf4f0affcac 100644 --- a/config.go +++ b/config.go @@ -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.