cmd: TrieTimeoutFlag configurable option added

This commit is contained in:
hackyminer 2018-11-07 22:54:51 +09:00
parent 27e3f96819
commit a46376486e
No known key found for this signature in database
GPG key ID: 46D453DDCA4B766F
2 changed files with 7 additions and 1 deletions

View file

@ -92,6 +92,7 @@ var (
utils.SyncModeFlag,
utils.ExitWhenSyncedFlag,
utils.GCModeFlag,
utils.TrieTimeoutFlag,
utils.LightServFlag,
utils.LightPeersFlag,
utils.LightKDFFlag,

View file

@ -197,6 +197,11 @@ var (
Usage: `Blockchain garbage collection mode ("full", "archive")`,
Value: "full",
}
TrieTimeoutFlag = cli.DurationFlag{
Name: "trietimeout",
Usage: `Time limit after which to flush the current in-memory trie to disk (default: 10s)`,
Value: eth.DefaultConfig.TrieTimeout,
}
LightServFlag = cli.IntFlag{
Name: "lightserv",
Usage: "Maximum percentage of time allowed for serving LES requests (0-90)",
@ -1588,7 +1593,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
Disabled: ctx.GlobalString(GCModeFlag.Name) == "archive",
TrieCleanLimit: eth.DefaultConfig.TrieCleanCache,
TrieDirtyLimit: eth.DefaultConfig.TrieDirtyCache,
TrieTimeLimit: eth.DefaultConfig.TrieTimeout,
TrieTimeLimit: ctx.GlobalDuration(TrieTimeoutFlag.Name),
}
if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheTrieFlag.Name) {
cache.TrieCleanLimit = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheTrieFlag.Name) / 100