cmd/utils: grant snapshot cache to trie if disabled (#21416)

* cmd/utils: grant snapshot cache to trie if disabled

* eth: fix up default non-mainnet cache distribution
This commit is contained in:
Péter Szilágyi
2020-08-06 15:28:31 +03:00
committed by GitHub
parent 5d4512b113
commit 68754f3931
2 changed files with 3 additions and 2 deletions

View File

@ -1542,6 +1542,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
cfg.SnapshotCache = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheSnapshotFlag.Name) / 100
}
if !ctx.GlobalIsSet(SnapshotFlag.Name) {
cfg.TrieCleanCache += cfg.SnapshotCache
cfg.SnapshotCache = 0 // Disabled
}
if ctx.GlobalIsSet(DocRootFlag.Name) {