Skip to content

Commit ce68ac6

Browse files
committed
Updated miner to new block api
1 parent dc7c584 commit ce68ac6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎miner/miner.go‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,11 @@ func (self *Miner) mine() {
190190

191191
transactions := self.finiliseTxs()
192192

193+
state := block.State()
194+
193195
// Accumulate all valid transactions and apply them to the new state
194196
// Error may be ignored. It's not important during mining
195-
receipts, txs, _, erroneous, err := blockManager.ApplyTransactions(coinbase, block.State(), block, transactions, true)
197+
receipts, txs, _, erroneous, err := blockManager.ApplyTransactions(coinbase, state, block, transactions, true)
196198
if err != nil {
197199
minerlogger.Debugln(err)
198200
}
@@ -202,9 +204,10 @@ func (self *Miner) mine() {
202204
block.SetReceipts(receipts)
203205

204206
// Accumulate the rewards included for this block
205-
blockManager.AccumelateRewards(block.State(), block, parent)
207+
blockManager.AccumelateRewards(state, block, parent)
206208

207-
block.State().Update(ethutil.Big0)
209+
state.Update(ethutil.Big0)
210+
block.SetRoot(state.Root())
208211

209212
minerlogger.Infof("Mining on block. Includes %v transactions", len(transactions))
210213

0 commit comments

Comments
 (0)