Skip to content

Commit

Permalink
Merge pull request ethereum#3515 from bas-vk/exportropsten
Browse files Browse the repository at this point in the history
core,cmd/utils: bugfix for ropsten dump imports
  • Loading branch information
karalabe authored Jan 5, 2017
2 parents bbc4ea4 + a1798a8 commit bbce726
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,11 +924,19 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
chainDb = MakeChainDatabase(ctx, stack)

if ctx.GlobalBool(OlympicFlag.Name) {
_, err := core.WriteOlympicGenesisBlock(chainDb)
if err != nil {
glog.Fatalln(err)
}
}

if ctx.GlobalBool(TestNetFlag.Name) {
_, err := core.WriteTestNetGenesisBlock(chainDb)
if err != nil {
glog.Fatalln(err)
}
}

chainConfig := MakeChainConfigFromDb(ctx, chainDb)

pow := pow.PoW(core.FakePow{})
Expand Down
2 changes: 2 additions & 0 deletions core/default_genesis.go

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func WriteDefaultGenesisBlock(chainDb ethdb.Database) (*types.Block, error) {
return WriteGenesisBlock(chainDb, strings.NewReader(DefaultGenesisBlock()))
}

// WriteTestNetGenesisBlock assembles the Morden test network genesis block and
// WriteTestNetGenesisBlock assembles the test network genesis block and
// writes it - along with all associated state - into a chain database.
func WriteTestNetGenesisBlock(chainDb ethdb.Database) (*types.Block, error) {
return WriteGenesisBlock(chainDb, strings.NewReader(DefaultTestnetGenesisBlock()))
Expand All @@ -198,6 +198,8 @@ func DefaultGenesisBlock() string {
return string(blob)
}

// DefaultTestnetGenesisBlock assembles a JSON string representing the default Ethereum
// test network genesis block.
func DefaultTestnetGenesisBlock() string {
reader := bzip2.NewReader(base64.NewDecoder(base64.StdEncoding, strings.NewReader(defaultTestnetGenesisBlock)))
blob, err := ioutil.ReadAll(reader)
Expand Down

0 comments on commit bbce726

Please sign in to comment.