From 14ce9e0fcacc9c6ea25ba3402d8ab362b6a2d7e4 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Mon, 24 Jun 2024 20:25:06 +0800 Subject: [PATCH] default ancient path --- pkg/snapshot/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/snapshot/config.go b/pkg/snapshot/config.go index ba7a52e..d329623 100644 --- a/pkg/snapshot/config.go +++ b/pkg/snapshot/config.go @@ -107,8 +107,11 @@ func (c *Config) Init(mode SnapshotMode) error { viper.BindEnv(ETHDB_ANCIENT_TOML, ETHDB_ANCIENT) viper.BindEnv(ETHDB_PATH_TOML, ETHDB_PATH) - c.Eth.AncientDBPath = viper.GetString(ETHDB_ANCIENT_TOML) c.Eth.DBPath = viper.GetString(ETHDB_PATH_TOML) + c.Eth.AncientDBPath = viper.GetString(ETHDB_ANCIENT_TOML) + if len(c.Eth.AncientDBPath) == 0 { + c.Eth.AncientDBPath = c.Eth.DBPath + "/ancient" + } switch mode { case FileSnapshot: