diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 7ea36da737..ae24d46f7c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1956,6 +1956,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (chain *core.B } if !ctx.GlobalIsSet(SnapshotFlag.Name) { cache.SnapshotLimit = 0 // Disabled + } else if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheSnapshotFlag.Name) { + cache.SnapshotLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheSnapshotFlag.Name) / 100 } // If we're in readonly, do not bother generating snapshot data. if readonly {