mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-20 06:49:27 +00:00
miner: moved state sync
Moved the state sync so it only syncs the state when the block mining yield a possitive result
This commit is contained in:
parent
a75b95b876
commit
1b9ef0e52d
1 changed files with 1 additions and 1 deletions
|
|
@ -263,6 +263,7 @@ func (self *worker) wait() {
|
||||||
}
|
}
|
||||||
block := result.Block
|
block := result.Block
|
||||||
|
|
||||||
|
self.current.state.Sync()
|
||||||
if self.fullValidation {
|
if self.fullValidation {
|
||||||
if _, err := self.chain.InsertChain(types.Blocks{block}); err != nil {
|
if _, err := self.chain.InsertChain(types.Blocks{block}); err != nil {
|
||||||
glog.V(logger.Error).Infoln("mining err", err)
|
glog.V(logger.Error).Infoln("mining err", err)
|
||||||
|
|
@ -489,7 +490,6 @@ func (self *worker) commitNewWork() {
|
||||||
// commit state root after all state transitions.
|
// commit state root after all state transitions.
|
||||||
core.AccumulateRewards(self.current.state, header, uncles)
|
core.AccumulateRewards(self.current.state, header, uncles)
|
||||||
current.state.SyncObjects()
|
current.state.SyncObjects()
|
||||||
self.current.state.Sync()
|
|
||||||
header.Root = current.state.Root()
|
header.Root = current.state.Root()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue