Skip to content

Commit

Permalink
cmd/utils: fix NetworkId default when -dev is set (ethereum#16833)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
jeremyschlatter authored and kielbarry committed Jul 9, 2018
1 parent 3568d75 commit 1dc36ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
}
cfg.Genesis = core.DefaultRinkebyGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337
}
// Create new developer account or reuse existing one
var (
developer accounts.Account
Expand Down

0 comments on commit 1dc36ef

Please sign in to comment.