Revert "cmd,eth: dry"

This reverts commit 97dad429f2.

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2025-03-17 19:19:28 +08:00
parent 474fd29ec8
commit 0bfaecafdd
3 changed files with 2 additions and 11 deletions

View file

@ -35,7 +35,6 @@ import (
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/internal/era" "github.com/ethereum/go-ethereum/internal/era"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
@ -223,7 +222,7 @@ func initGenesis(ctx *cli.Context) error {
overrides.OverrideVerkle = &v overrides.OverrideVerkle = &v
} }
chaindb, err := stack.OpenDatabaseWithFreezer(ethconfig.ChainDbName, 0, 0, ctx.String(utils.AncientFlag.Name), ethconfig.ChainDbNamespace, false) chaindb, err := stack.OpenDatabaseWithFreezer("chaindata", 0, 0, ctx.String(utils.AncientFlag.Name), "", false)
if err != nil { if err != nil {
utils.Fatalf("Failed to open database: %v", err) utils.Fatalf("Failed to open database: %v", err)
} }

View file

@ -2029,7 +2029,7 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
} }
chainDb = remotedb.New(client) chainDb = remotedb.New(client)
default: default:
chainDb, err = stack.OpenDatabaseWithFreezer(ethconfig.ChainDbName, cache, handles, ctx.String(AncientFlag.Name), ethconfig.ChainDbNamespace, readonly) chainDb, err = stack.OpenDatabaseWithFreezer("chaindata", cache, handles, ctx.String(AncientFlag.Name), "eth/db/chaindata/", readonly)
} }
if err != nil { if err != nil {
Fatalf("Could not open database: %v", err) Fatalf("Could not open database: %v", err)

View file

@ -36,14 +36,6 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
) )
const (
// ChainDbName is the name of the chain database
ChainDbName = "chaindata"
// ChainDbNamespace is the namespace for the chain database
ChainDbNamespace = "eth/db/chaindata/"
)
// FullNodeGPO contains default gasprice oracle settings for full node. // FullNodeGPO contains default gasprice oracle settings for full node.
var FullNodeGPO = gasprice.Config{ var FullNodeGPO = gasprice.Config{
Blocks: 20, Blocks: 20,