aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-10-22 02:44:22 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-10-22 02:44:22 +0800
commit0467a6ceec4973b00c344d2a724f7fb01a6b0aee (patch)
tree66e010270bdf25fa0058c89fb31f6df8cf7f7829 /cmd/utils/flags.go
parentdba15d9c3609bcddfc7a4f0fe8f01c48a8bbfbc8 (diff)
parent5b0ee8ec304663898073b7a4c659e1def23716df (diff)
downloaddexon-0467a6ceec4973b00c344d2a724f7fb01a6b0aee.tar.gz
dexon-0467a6ceec4973b00c344d2a724f7fb01a6b0aee.tar.zst
dexon-0467a6ceec4973b00c344d2a724f7fb01a6b0aee.zip
Merge pull request #1889 from karalabe/fast-sync-rebase
eth/63 fast synchronization algorithm
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go23
1 files changed, 5 insertions, 18 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index ca9dd76fd..060d80b35 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -148,10 +148,9 @@ var (
Name: "olympic",
Usage: "Use olympic style protocol",
}
- EthVersionFlag = cli.IntFlag{
- Name: "eth",
- Value: 62,
- Usage: "Highest eth protocol to advertise (temporary, dev option)",
+ FastSyncFlag = cli.BoolFlag{
+ Name: "fast",
+ Usage: "Enables fast syncing through state downloads",
}
// miner settings
@@ -425,12 +424,13 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
if err != nil {
glog.V(logger.Error).Infoln("WARNING: No etherbase set and no accounts found as default")
}
-
+ // Assemble the entire eth configuration and return
cfg := &eth.Config{
Name: common.MakeName(clientID, version),
DataDir: MustDataDir(ctx),
GenesisNonce: ctx.GlobalInt(GenesisNonceFlag.Name),
GenesisFile: ctx.GlobalString(GenesisFileFlag.Name),
+ FastSync: ctx.GlobalBool(FastSyncFlag.Name),
BlockChainVersion: ctx.GlobalInt(BlockchainVersionFlag.Name),
DatabaseCache: ctx.GlobalInt(CacheFlag.Name),
SkipBcVersionCheck: false,
@@ -499,7 +499,6 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
glog.V(logger.Info).Infoln("dev mode enabled")
}
-
return cfg
}
@@ -532,18 +531,6 @@ func SetupVM(ctx *cli.Context) {
vm.SetJITCacheSize(ctx.GlobalInt(VMJitCacheFlag.Name))
}
-// SetupEth configures the eth packages global settings
-func SetupEth(ctx *cli.Context) {
- version := ctx.GlobalInt(EthVersionFlag.Name)
- for len(eth.ProtocolVersions) > 0 && eth.ProtocolVersions[0] > uint(version) {
- eth.ProtocolVersions = eth.ProtocolVersions[1:]
- eth.ProtocolLengths = eth.ProtocolLengths[1:]
- }
- if len(eth.ProtocolVersions) == 0 {
- Fatalf("No valid eth protocols remaining")
- }
-}
-
// MakeChain creates a chain manager from set command line flags.
func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database) {
datadir := MustDataDir(ctx)