diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-30 20:18:19 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-30 20:18:19 +0800 |
commit | ce68ac695981523aca5cf83e051597f46070547d (patch) | |
tree | b7cd9835d4cd26208b38411505b81d18268ea48d /miner/miner.go | |
parent | dc7c584a4de371e449752dce5b5e90b26c83d0bb (diff) | |
download | dexon-ce68ac695981523aca5cf83e051597f46070547d.tar.gz dexon-ce68ac695981523aca5cf83e051597f46070547d.tar.zst dexon-ce68ac695981523aca5cf83e051597f46070547d.zip |
Updated miner to new block api
Diffstat (limited to 'miner/miner.go')
-rw-r--r-- | miner/miner.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/miner/miner.go b/miner/miner.go index c9a6922bb..aefcadab8 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -190,9 +190,11 @@ func (self *Miner) mine() { 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 := blockManager.ApplyTransactions(coinbase, block.State(), block, transactions, true) + receipts, txs, _, erroneous, err := blockManager.ApplyTransactions(coinbase, state, block, transactions, true) if err != nil { minerlogger.Debugln(err) } @@ -202,9 +204,10 @@ func (self *Miner) mine() { block.SetReceipts(receipts) // Accumulate the rewards included for this block - blockManager.AccumelateRewards(block.State(), block, parent) + blockManager.AccumelateRewards(state, block, parent) - block.State().Update(ethutil.Big0) + state.Update(ethutil.Big0) + block.SetRoot(state.Root()) minerlogger.Infof("Mining on block. Includes %v transactions", len(transactions)) |