forked from forks/go-ethereum
cmd: apply snapshot cache flag in the MakeChain (#31534)
This commit is contained in:
parent
1bd70ba57a
commit
4add312c8a
1 changed files with 2 additions and 0 deletions
|
|
@ -2189,6 +2189,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
|
|||
}
|
||||
if !ctx.Bool(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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue