Skip to content

Commit ddf7077

Browse files
jsvisasivaratrisrinivas
authored andcommitted
cmd: apply snapshot cache flag in the MakeChain (ethereum#31534)
1 parent eed82c8 commit ddf7077

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/utils/flags.go

+2
Original file line numberDiff line numberDiff line change
@@ -2189,6 +2189,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
21892189
}
21902190
if !ctx.Bool(SnapshotFlag.Name) {
21912191
cache.SnapshotLimit = 0 // Disabled
2192+
} else if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheSnapshotFlag.Name) {
2193+
cache.SnapshotLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheSnapshotFlag.Name) / 100
21922194
}
21932195
// If we're in readonly, do not bother generating snapshot data.
21942196
if readonly {

0 commit comments

Comments
 (0)