Skip to content

Commit 93ccb43

Browse files
mask-pphowjmay
authored andcommitted
cmd/utils: force hash scheme for archive mode (ethereum#31439)
1 parent 20ae3f0 commit 93ccb43

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cmd/utils/flags.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,12 +1659,16 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
16591659
log.Warn("The flag --txlookuplimit is deprecated and will be removed, please use --history.transactions")
16601660
cfg.TransactionHistory = ctx.Uint64(TxLookupLimitFlag.Name)
16611661
}
1662-
if ctx.String(GCModeFlag.Name) == "archive" && cfg.TransactionHistory != 0 {
1663-
cfg.TransactionHistory = 0
1664-
log.Warn("Disabled transaction unindexing for archive node")
1662+
if ctx.String(GCModeFlag.Name) == "archive" {
1663+
if cfg.TransactionHistory != 0 {
1664+
cfg.TransactionHistory = 0
1665+
log.Warn("Disabled transaction unindexing for archive node")
1666+
}
16651667

1666-
cfg.StateScheme = rawdb.HashScheme
1667-
log.Warn("Forcing hash state-scheme for archive mode")
1668+
if cfg.StateScheme != rawdb.HashScheme {
1669+
cfg.StateScheme = rawdb.HashScheme
1670+
log.Warn("Forcing hash state-scheme for archive mode")
1671+
}
16681672
}
16691673
if ctx.IsSet(LogHistoryFlag.Name) {
16701674
cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name)

0 commit comments

Comments
 (0)