|
|
@ -772,23 +772,22 @@ func MustMakeChainConfig(ctx *cli.Context) *core.ChainConfig { |
|
|
|
) |
|
|
|
) |
|
|
|
defer db.Close() |
|
|
|
defer db.Close() |
|
|
|
|
|
|
|
|
|
|
|
chainConfig, err := core.GetChainConfig(db, genesis.Hash()) |
|
|
|
if genesis != nil { |
|
|
|
if err != nil { |
|
|
|
// Exsting genesis block, use stored config if available.
|
|
|
|
if err != core.ChainConfigNotFoundErr { |
|
|
|
storedConfig, err := core.GetChainConfig(db, genesis.Hash()) |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
|
|
|
|
return storedConfig |
|
|
|
|
|
|
|
} else if err != core.ChainConfigNotFoundErr { |
|
|
|
Fatalf("Could not make chain configuration: %v", err) |
|
|
|
Fatalf("Could not make chain configuration: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
var homesteadBlockNo *big.Int |
|
|
|
var homesteadBlockNo *big.Int |
|
|
|
if ctx.GlobalBool(TestNetFlag.Name) { |
|
|
|
if ctx.GlobalBool(TestNetFlag.Name) { |
|
|
|
homesteadBlockNo = params.TestNetHomesteadBlock |
|
|
|
homesteadBlockNo = params.TestNetHomesteadBlock |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
homesteadBlockNo = params.MainNetHomesteadBlock |
|
|
|
homesteadBlockNo = params.MainNetHomesteadBlock |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return &core.ChainConfig{HomesteadBlock: homesteadBlockNo} |
|
|
|
chainConfig = &core.ChainConfig{ |
|
|
|
|
|
|
|
HomesteadBlock: homesteadBlockNo, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return chainConfig |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails.
|
|
|
|
// MakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails.
|
|
|
|