aboutsummaryrefslogtreecommitdiffstats
path: root/miner/miner.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-07 20:17:48 +0800
committerobscuren <geffobscura@gmail.com>2015-01-07 20:17:48 +0800
commitfed3e6a808921fb8274b50043c5c39a24a1bbccf (patch)
treed632e95cfce78bd9a99a52bf7f30ee3ff980dfd3 /miner/miner.go
parent032ab665299d75bffc25260e8fa477ace19db06a (diff)
downloadgo-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.gz
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.bz2
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.lz
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.xz
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.zst
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.zip
Refactored ethutil.Config.Db out
Diffstat (limited to 'miner/miner.go')
-rw-r--r--miner/miner.go6
1 files changed, 3 insertions, 3 deletions
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)