Commit 1b9ef0e5 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke

miner: moved state sync

Moved the state sync so it only syncs the state when the block mining yield a possitive result
parent a75b95b8
......@@ -263,6 +263,7 @@ func (self *worker) wait() {
}
block := result.Block
self.current.state.Sync()
if self.fullValidation {
if _, err := self.chain.InsertChain(types.Blocks{block}); err != nil {
glog.V(logger.Error).Infoln("mining err", err)
......@@ -489,7 +490,6 @@ func (self *worker) commitNewWork() {
// commit state root after all state transitions.
core.AccumulateRewards(self.current.state, header, uncles)
current.state.SyncObjects()
self.current.state.Sync()
header.Root = current.state.Root()
}
......
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