Skip to content

Commit

Permalink
Merge pull request gcash#433 from gcash/no-prune-index
Browse files Browse the repository at this point in the history
[Bug] Print error and exit if indexing and running a pruned node
  • Loading branch information
cpacia authored Dec 9, 2020
2 parents 175c1e8 + e5c8ab2 commit eb04398
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit eb04398

Please sign in to comment.