From 76e01aa6e7c2e24a00d4980fae1241facf8cc8e4 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Wed, 9 May 2018 18:34:22 +0800 Subject: [PATCH] core: clean up variables definition --- core/chain_makers.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/chain_makers.go b/core/chain_makers.go index 3fb2ecbd92..fcba90bb87 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -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 {