Skip to content

Commit 1dc36ef

Browse files
jeremyschlatterkielbarry
authored andcommitted
cmd/utils: fix NetworkId default when -dev is set (ethereum#16833)
Prior to this change, when geth was started with `geth -dev -rpc`, it would report a network id of `1` in response to the `net_version` RPC request. But the actual network id it used to verify transactions was `1337`. This change causes geth instead respond with `1337` to the `net_version` RPC when geth is started with `geth -dev -rpc`.
1 parent 3568d75 commit 1dc36ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/utils/flags.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
10841084
}
10851085
cfg.Genesis = core.DefaultRinkebyGenesisBlock()
10861086
case ctx.GlobalBool(DeveloperFlag.Name):
1087+
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
1088+
cfg.NetworkId = 1337
1089+
}
10871090
// Create new developer account or reuse existing one
10881091
var (
10891092
developer accounts.Account

0 commit comments

Comments
 (0)