From fed3e6a808921fb8274b50043c5c39a24a1bbccf Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 7 Jan 2015 13:17:48 +0100 Subject: Refactored ethutil.Config.Db out --- miner/miner.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'miner') diff --git a/miner/miner.go b/miner/miner.go index f80ae51c6..52dd5687d 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -31,6 +31,7 @@ import ( "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/pow" "github.com/ethereum/go-ethereum/pow/ezp" + "github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" @@ -178,6 +179,7 @@ func (self *Miner) mine() { blockProcessor = self.eth.BlockProcessor() chainMan = self.eth.ChainManager() block = chainMan.NewBlock(self.Coinbase) + state = state.New(block.Root(), self.eth.Db()) ) block.Header().Extra = self.Extra @@ -187,13 +189,11 @@ func (self *Miner) mine() { } parent := chainMan.GetBlock(block.ParentHash()) - coinbase := block.State().GetOrNewStateObject(block.Coinbase()) + coinbase := state.GetOrNewStateObject(block.Coinbase()) coinbase.SetGasPool(core.CalcGasLimit(parent, block)) transactions := self.finiliseTxs() - state := block.State() - // Accumulate all valid transactions and apply them to the new state // Error may be ignored. It's not important during mining receipts, txs, _, erroneous, err := blockProcessor.ApplyTransactions(coinbase, state, block, transactions, true) -- cgit v1.2.3