From d6225ab846d1abeeb9ba9e9aad84bc566ddf52f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 5 Feb 2019 12:49:59 +0200 Subject: cmd/utils, eth: relinquish GC cache to read cache in archive mode --- eth/backend.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'eth') diff --git a/eth/backend.go b/eth/backend.go index 3ec6749b6..6a136182a 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -113,6 +113,12 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { log.Warn("Sanitizing invalid miner gas price", "provided", config.MinerGasPrice, "updated", DefaultConfig.MinerGasPrice) config.MinerGasPrice = new(big.Int).Set(DefaultConfig.MinerGasPrice) } + if config.NoPruning && config.TrieDirtyCache > 0 { + config.TrieCleanCache += config.TrieDirtyCache + config.TrieDirtyCache = 0 + } + log.Info("Allocated trie memory caches", "clean", common.StorageSize(config.TrieCleanCache)*1024*1024, "dirty", common.StorageSize(config.TrieDirtyCache)*1024*1024) + // Assemble the Ethereum object chainDb, err := CreateDB(ctx, config, "chaindata") if err != nil { -- cgit v1.2.3