diff options
-rw-r--r-- | cmd/geth/chaincmd.go | 3 | ||||
-rw-r--r-- | cmd/geth/main.go | 5 | ||||
-rw-r--r-- | cmd/utils/flags.go | 17 |
3 files changed, 8 insertions, 17 deletions
diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 321551ce0..54984d6e0 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -76,6 +76,9 @@ func importChain(ctx *cli.Context) error { if len(ctx.Args()) != 1 { utils.Fatalf("This command requires an argument.") } + if ctx.GlobalBool(utils.TestNetFlag.Name) { + state.StartingNonce = 1048576 // (2**20) + } chain, chainDb := utils.MakeChain(ctx) start := time.Now() err := utils.ImportChain(chain, ctx.Args().First()) 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) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 067faf3ce..de953ff47 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -800,23 +800,6 @@ func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainC case ctx.GlobalBool(OpposeDAOFork.Name): config.DAOForkSupport = false } - // Temporarilly display a proper message so the user knows which fork its on - if !ctx.GlobalBool(TestNetFlag.Name) && (genesis == nil || genesis.Hash() == common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3")) { - choice := "SUPPORT" - if !config.DAOForkSupport { - choice = "OPPOSE" - } - current := fmt.Sprintf("Geth is currently configured to %s the DAO hard-fork!", choice) - howtoswap := fmt.Sprintf("You can change your choice prior to block #%v with --support-dao-fork or --oppose-dao-fork.", config.DAOForkBlock) - howtosync := fmt.Sprintf("After the hard-fork block #%v passed, changing chains requires a resync from scratch!", config.DAOForkBlock) - separator := strings.Repeat("-", len(howtoswap)) - - glog.V(logger.Warn).Info(separator) - glog.V(logger.Warn).Info(current) - glog.V(logger.Warn).Info(howtoswap) - glog.V(logger.Warn).Info(howtosync) - glog.V(logger.Warn).Info(separator) - } return config } |