From e5c8ab2341d0f2e252ae2099f02499c35c81cb55 Mon Sep 17 00:00:00 2001 From: quest Date: Tue, 8 Dec 2020 19:27:15 -1000 Subject: [PATCH] Print error and exit if indexing and running a pruned node --- config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.go b/config.go index 14bfeeaff..2cd7f4c3a 100644 --- a/config.go +++ b/config.go @@ -613,6 +613,15 @@ func loadConfig() (*config, []string, error) { return nil, nil, err } + // Indexing doesn't work with a pruned blockchain. + if (cfg.TxIndex || cfg.AddrIndex) && cfg.Prune { + str := "%s: txindex and addrindex can not be used with a pruned blockchain." + err := fmt.Errorf(str, funcName) + fmt.Fprintln(os.Stderr, err) + fmt.Fprintln(os.Stderr, usageMessage) + return nil, nil, err + } + // Indexing also doesn't work with fast sync as the indexes will not go // back to genesis. if (cfg.TxIndex || cfg.AddrIndex) && cfg.FastSync {