mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 00:39:26 +00:00
cmd/utils: require TTD and difficulty to be zero at genesis for dev mode (#29579)
This commit is contained in:
parent
69f815f6f5
commit
c04b8e6d74
1 changed files with 6 additions and 4 deletions
|
|
@ -1872,13 +1872,15 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
Fatalf("Could not read genesis from database: %v", err)
|
Fatalf("Could not read genesis from database: %v", err)
|
||||||
}
|
}
|
||||||
if !genesis.Config.TerminalTotalDifficultyPassed {
|
if !genesis.Config.TerminalTotalDifficultyPassed {
|
||||||
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficultyPassed must be true in developer mode")
|
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficultyPassed must be true")
|
||||||
}
|
}
|
||||||
if genesis.Config.TerminalTotalDifficulty == nil {
|
if genesis.Config.TerminalTotalDifficulty == nil {
|
||||||
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be specified.")
|
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be specified")
|
||||||
|
} else if genesis.Config.TerminalTotalDifficulty.Cmp(big.NewInt(0)) != 0 {
|
||||||
|
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be 0")
|
||||||
}
|
}
|
||||||
if genesis.Difficulty.Cmp(genesis.Config.TerminalTotalDifficulty) != 1 {
|
if genesis.Difficulty.Cmp(big.NewInt(0)) != 0 {
|
||||||
Fatalf("Bad developer-mode genesis configuration: genesis block difficulty must be > terminalTotalDifficulty")
|
Fatalf("Bad developer-mode genesis configuration: difficulty must be 0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chaindb.Close()
|
chaindb.Close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue