mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/utils: don't change func name
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
4aafa5a9ef
commit
5d3e1080ce
1 changed files with 3 additions and 3 deletions
|
|
@ -1867,7 +1867,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
// Create a new developer genesis block or reuse existing one
|
// Create a new developer genesis block or reuse existing one
|
||||||
cfg.Genesis = core.DeveloperGenesisBlock(ctx.Uint64(DeveloperGasLimitFlag.Name), developer.Address)
|
cfg.Genesis = core.DeveloperGenesisBlock(ctx.Uint64(DeveloperGasLimitFlag.Name), developer.Address)
|
||||||
if ctx.IsSet(DataDirFlag.Name) {
|
if ctx.IsSet(DataDirFlag.Name) {
|
||||||
chaindb := tryMakeReadOnlyChainDB(ctx, stack)
|
chaindb := tryMakeReadOnlyDatabase(ctx, stack)
|
||||||
if rawdb.ReadCanonicalHash(chaindb, 0) != (common.Hash{}) {
|
if rawdb.ReadCanonicalHash(chaindb, 0) != (common.Hash{}) {
|
||||||
cfg.Genesis = nil // fallback to db content
|
cfg.Genesis = nil // fallback to db content
|
||||||
}
|
}
|
||||||
|
|
@ -2072,9 +2072,9 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
|
||||||
return chainDb
|
return chainDb
|
||||||
}
|
}
|
||||||
|
|
||||||
// tryMakeReadOnlyChainDB try to open the chain database(without ancient) in read-only mode,
|
// tryMakeReadOnlyDatabase try to open the chain database(without ancient) in read-only mode,
|
||||||
// or fallback to write mode if the database is not initialized.
|
// or fallback to write mode if the database is not initialized.
|
||||||
func tryMakeReadOnlyChainDB(ctx *cli.Context, stack *node.Node) ethdb.Database {
|
func tryMakeReadOnlyDatabase(ctx *cli.Context, stack *node.Node) ethdb.Database {
|
||||||
// If the database doesn't exist we need to open it in write-mode to allow
|
// If the database doesn't exist we need to open it in write-mode to allow
|
||||||
// the engine to create files.
|
// the engine to create files.
|
||||||
readonly := true
|
readonly := true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue