Skip to content

Commit

Permalink
core: clean up variables definition
Browse files Browse the repository at this point in the history
  • Loading branch information
rjl493456442 committed May 9, 2018
1 parent a3bc74f commit 76e01aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S
// chain. Depending on the full flag, if creates either a full block chain or a
// header only chain.
func newCanonical(engine consensus.Engine, n int, full bool) (ethdb.Database, *BlockChain, error) {
// Initialize a fresh chain with only a genesis block
gspec := new(Genesis)
db := ethdb.NewMemDatabase()
genesis := gspec.MustCommit(db)
var (
db = ethdb.NewMemDatabase()
genesis = new(Genesis).MustCommit(db)
)

// Initialize a fresh chain with only a genesis block
blockchain, _ := NewBlockChain(db, nil, params.AllEthashProtocolChanges, engine, vm.Config{})
// Create and inject the requested chain
if n == 0 {
Expand Down

0 comments on commit 76e01aa

Please sign in to comment.