mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
cmd,eth: dry
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
66b166b55a
commit
97dad429f2
3 changed files with 11 additions and 2 deletions
|
|
@ -35,6 +35,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
||||
"github.com/ethereum/go-ethereum/ethdb"
|
||||
"github.com/ethereum/go-ethereum/internal/era"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
|
|
@ -222,7 +223,7 @@ func initGenesis(ctx *cli.Context) error {
|
|||
overrides.OverrideVerkle = &v
|
||||
}
|
||||
|
||||
chaindb, err := stack.OpenDatabaseWithFreezer("chaindata", 0, 0, ctx.String(utils.AncientFlag.Name), "", false)
|
||||
chaindb, err := stack.OpenDatabaseWithFreezer(ethconfig.ChainDbName, 0, 0, ctx.String(utils.AncientFlag.Name), ethconfig.ChainDbNamespace, false)
|
||||
if err != nil {
|
||||
utils.Fatalf("Failed to open database: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2029,7 +2029,7 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
|
|||
}
|
||||
chainDb = remotedb.New(client)
|
||||
default:
|
||||
chainDb, err = stack.OpenDatabaseWithFreezer("chaindata", cache, handles, ctx.String(AncientFlag.Name), "eth/db/chaindata/", readonly)
|
||||
chainDb, err = stack.OpenDatabaseWithFreezer(ethconfig.ChainDbName, cache, handles, ctx.String(AncientFlag.Name), ethconfig.ChainDbNamespace, readonly)
|
||||
}
|
||||
if err != nil {
|
||||
Fatalf("Could not open database: %v", err)
|
||||
|
|
|
|||
|
|
@ -36,6 +36,14 @@ import (
|
|||
"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.
|
||||
var FullNodeGPO = gasprice.Config{
|
||||
Blocks: 20,
|
||||
|
|
|
|||
Loading…
Reference in a new issue