mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-14 20:16:36 +00:00
cmd/geth: respect --dev=false (#34920)
Passing `--dev=false` currently still enters the dev-mode startup path because a couple of branches check whether the flag was set, not its boolean value. This switches those branches to use `ctx.Bool`, so explicit false does not start dev mode or emit a dev genesis, while `--dev` keeps its existing behavior.
This commit is contained in:
parent
934a0091fa
commit
2f11dccca0
2 changed files with 2 additions and 2 deletions
|
|
@ -325,7 +325,7 @@ func dumpGenesis(ctx *cli.Context) error {
|
||||||
var genesis *core.Genesis
|
var genesis *core.Genesis
|
||||||
if utils.IsNetworkPreset(ctx) {
|
if utils.IsNetworkPreset(ctx) {
|
||||||
genesis = utils.MakeGenesis(ctx)
|
genesis = utils.MakeGenesis(ctx)
|
||||||
} else if ctx.IsSet(utils.DeveloperFlag.Name) && !ctx.IsSet(utils.DataDirFlag.Name) {
|
} else if ctx.Bool(utils.DeveloperFlag.Name) && !ctx.IsSet(utils.DataDirFlag.Name) {
|
||||||
genesis = core.DeveloperGenesisBlock(11_500_000, nil)
|
genesis = core.DeveloperGenesisBlock(11_500_000, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,7 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
}
|
}
|
||||||
utils.RegisterSyncOverrideService(stack, eth, syncConfig)
|
utils.RegisterSyncOverrideService(stack, eth, syncConfig)
|
||||||
|
|
||||||
if ctx.IsSet(utils.DeveloperFlag.Name) {
|
if ctx.Bool(utils.DeveloperFlag.Name) {
|
||||||
// Start dev mode.
|
// Start dev mode.
|
||||||
simBeacon, err := catalyst.NewSimulatedBeacon(ctx.Uint64(utils.DeveloperPeriodFlag.Name), cfg.Eth.Miner.PendingFeeRecipient, eth)
|
simBeacon, err := catalyst.NewSimulatedBeacon(ctx.Uint64(utils.DeveloperPeriodFlag.Name), cfg.Eth.Miner.PendingFeeRecipient, eth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue