diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-05-03 18:35:47 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-05-03 18:35:47 +0800 |
commit | 181a3309dfac92ca2715c0f32f270b536008768e (patch) | |
tree | e1fdf71214dc035cfbd451178402786419228067 /cmd/utils | |
parent | 02fa3e3179011bcbdf9142f9efba8d3a52df8987 (diff) | |
download | dexon-181a3309dfac92ca2715c0f32f270b536008768e.tar dexon-181a3309dfac92ca2715c0f32f270b536008768e.tar.gz dexon-181a3309dfac92ca2715c0f32f270b536008768e.tar.bz2 dexon-181a3309dfac92ca2715c0f32f270b536008768e.tar.lz dexon-181a3309dfac92ca2715c0f32f270b536008768e.tar.xz dexon-181a3309dfac92ca2715c0f32f270b536008768e.tar.zst dexon-181a3309dfac92ca2715c0f32f270b536008768e.zip |
cmd/geth, cmd/utils: init/removedb on light/full dbs simultaneously
Diffstat (limited to 'cmd/utils')
-rw-r--r-- | cmd/utils/flags.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 9e80bba60..c47301dfb 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -908,22 +908,16 @@ func SetupNetwork(ctx *cli.Context) { params.TargetGasLimit = new(big.Int).SetUint64(ctx.GlobalUint64(TargetGasLimitFlag.Name)) } -func ChainDbName(ctx *cli.Context) string { - if ctx.GlobalBool(LightModeFlag.Name) { - return "lightchaindata" - } else { - return "chaindata" - } -} - // MakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails. func MakeChainDatabase(ctx *cli.Context, stack *node.Node) ethdb.Database { var ( cache = ctx.GlobalInt(CacheFlag.Name) handles = makeDatabaseHandles() - name = ChainDbName(ctx) ) - + name := "chaindata" + if ctx.GlobalBool(LightModeFlag.Name) { + name = "lightchaindata" + } chainDb, err := stack.OpenDatabase(name, cache, handles) if err != nil { Fatalf("Could not open database: %v", err) |