Move statediff on/off check to geth cmd config
This commit is contained in:
parent
32a0a23821
commit
70d531dc1e
@ -178,6 +178,10 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
||||
if cfg.Ethstats.URL != "" {
|
||||
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
|
||||
}
|
||||
|
||||
if ctx.GlobalBool(utils.StateDiffFlag.Name) {
|
||||
utils.RegisterStateDiffService(stack)
|
||||
}
|
||||
return stack
|
||||
}
|
||||
|
||||
|
@ -1134,13 +1134,6 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
|
||||
}
|
||||
}
|
||||
|
||||
// Check if state diff flags are on and applies them to eth context
|
||||
func setStateDiff(ctx *cli.Context, cfg *eth.Config) {
|
||||
if ctx.GlobalBool(StateDiffFlag.Name) && cfg.NoPruning && cfg.SyncMode == downloader.FullSync {
|
||||
cfg.StateDiff.On = true
|
||||
}
|
||||
}
|
||||
|
||||
// SetEthConfig applies eth-related command line flags to the config.
|
||||
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
|
||||
// Avoid conflicting network flags
|
||||
@ -1176,10 +1169,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
|
||||
}
|
||||
cfg.NoPruning = ctx.GlobalString(GCModeFlag.Name) == "archive"
|
||||
|
||||
if ctx.GlobalIsSet(StateDiffFlag.Name) {
|
||||
setStateDiff(ctx, cfg)
|
||||
}
|
||||
|
||||
if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheTrieFlag.Name) {
|
||||
cfg.TrieCleanCache = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheTrieFlag.Name) / 100
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
package eth
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/statediff"
|
||||
"math/big"
|
||||
"os"
|
||||
"os/user"
|
||||
@ -129,9 +128,6 @@ type Config struct {
|
||||
EWASMInterpreter string
|
||||
// Type of the EVM interpreter ("" for default)
|
||||
EVMInterpreter string
|
||||
|
||||
// Config for state diff building
|
||||
StateDiff statediff.Config
|
||||
}
|
||||
|
||||
type configMarshaling struct {
|
||||
|
Loading…
Reference in New Issue
Block a user