mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 19:40:36 +00:00
miner: update root only when mining
This commit is contained in:
parent
e349fac97d
commit
ac80ec59dc
@ -416,10 +416,12 @@ func (self *worker) commitNewWork() {
|
||||
delete(self.possibleUncles, hash)
|
||||
}
|
||||
|
||||
// commit state root after all state transitions.
|
||||
core.AccumulateRewards(self.current.state, header, uncles)
|
||||
current.state.Update()
|
||||
header.Root = current.state.Root()
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user