aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-05-03 18:35:47 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-05-03 18:35:47 +0800
commit181a3309dfac92ca2715c0f32f270b536008768e (patch)
treee1fdf71214dc035cfbd451178402786419228067 /cmd/utils
parent02fa3e3179011bcbdf9142f9efba8d3a52df8987 (diff)
downloadgo-tangerine-181a3309dfac92ca2715c0f32f270b536008768e.tar.gz
go-tangerine-181a3309dfac92ca2715c0f32f270b536008768e.tar.zst
go-tangerine-181a3309dfac92ca2715c0f32f270b536008768e.zip
cmd/geth, cmd/utils: init/removedb on light/full dbs simultaneously
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go14
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)