diff options
author | Hellsegga <github@agerberg.me> | 2016-08-23 16:36:40 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-08-23 16:36:40 +0800 |
commit | 6bd9008025478f377f08d2d1b7b258e57486c956 (patch) | |
tree | 6e2500c6c51624d422ea0e918903625c72cf42d5 /cmd/geth/main.go | |
parent | 7d9c5e0f7d7de6d8bef3b1c1ed8350f5a75c446b (diff) | |
download | dexon-6bd9008025478f377f08d2d1b7b258e57486c956.tar dexon-6bd9008025478f377f08d2d1b7b258e57486c956.tar.gz dexon-6bd9008025478f377f08d2d1b7b258e57486c956.tar.bz2 dexon-6bd9008025478f377f08d2d1b7b258e57486c956.tar.lz dexon-6bd9008025478f377f08d2d1b7b258e57486c956.tar.xz dexon-6bd9008025478f377f08d2d1b7b258e57486c956.tar.zst dexon-6bd9008025478f377f08d2d1b7b258e57486c956.zip |
cmd/geth: set correct initial nonce on testnet for import/init subcommands (#2924)
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r-- | cmd/geth/main.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index a5b46d7a4..620ff3178 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -33,6 +33,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/internal/debug" @@ -266,6 +267,10 @@ func initGenesis(ctx *cli.Context) error { utils.Fatalf("must supply path to genesis JSON file") } + if ctx.GlobalBool(utils.TestNetFlag.Name) { + state.StartingNonce = 1048576 // (2**20) + } + chainDb, err := ethdb.NewLDBDatabase(filepath.Join(utils.MustMakeDataDir(ctx), "chaindata"), 0, 0) if err != nil { utils.Fatalf("could not open database: %v", err) |