Commit ac80ec59 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke

miner: update root only when mining

parent e349fac9
......@@ -416,10 +416,12 @@ func (self *worker) commitNewWork() {
delete(self.possibleUncles, hash)
}
if atomic.LoadInt32(&self.mining) == 1 {
// commit state root after all state transitions.
core.AccumulateRewards(self.current.state, header, uncles)
current.state.Update()
header.Root = current.state.Root()
}
// create the new block whose nonce will be mined.
current.block = types.NewBlock(header, current.txs, uncles, current.receipts)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment