Skip to content

Commit ffeaf04

Browse files
committed
set developer default genesis block difficulty to 0. add validation that developer genesis block ttd == difficulty == 0.
1 parent 0da69e8 commit ffeaf04

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/utils/flags.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,8 +1877,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
18771877
if genesis.Config.TerminalTotalDifficulty == nil {
18781878
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be specified.")
18791879
}
1880-
if genesis.Difficulty.Cmp(genesis.Config.TerminalTotalDifficulty) != 1 {
1881-
Fatalf("Bad developer-mode genesis configuration: genesis block difficulty must be > terminalTotalDifficulty")
1880+
if genesis.Difficulty.Cmp(big.NewInt(0)) != 0 {
1881+
Fatalf("Bad developer-mode genesis configuration: genesis block difficulty must be 0")
1882+
}
1883+
if genesis.Config.TerminalTotalDifficulty.Cmp(big.NewInt(0)) != 0 {
1884+
Fatalf("Bad developer-mode genesis configuration: genesis block terminalTotalDifficulty must be 0")
18821885
}
18831886
}
18841887
chaindb.Close()

0 commit comments

Comments
 (0)