aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-10-01 19:34:38 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-10-01 19:34:38 +0800
commit49ae53850622f3ea051184dccc867fbfec4c9ecb (patch)
tree669f4b161773c9b95c6631e83a3c34d446c33fef /miner/worker.go
parent581c0901af22d678aedd9eefae6144582c23e1a0 (diff)
parentc1a352c1085baa5c5f7650d331603bbb5532dea4 (diff)
downloadgo-tangerine-49ae53850622f3ea051184dccc867fbfec4c9ecb.tar.gz
go-tangerine-49ae53850622f3ea051184dccc867fbfec4c9ecb.tar.zst
go-tangerine-49ae53850622f3ea051184dccc867fbfec4c9ecb.zip
Merge pull request #1405 from fjl/lean-trie
core, trie: new trie
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 22d0b9b6e..098f42a72 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -266,7 +266,6 @@ func (self *worker) wait() {
block := result.Block
work := result.Work
- work.state.Sync()
if self.fullValidation {
if _, err := self.chain.InsertChain(types.Blocks{block}); err != nil {
glog.V(logger.Error).Infoln("mining err", err)
@@ -274,6 +273,7 @@ func (self *worker) wait() {
}
go self.mux.Post(core.NewMinedBlockEvent{block})
} else {
+ work.state.Commit()
parent := self.chain.GetBlock(block.ParentHash())
if parent == nil {
glog.V(logger.Error).Infoln("Invalid block found during mining")
@@ -528,8 +528,7 @@ func (self *worker) commitNewWork() {
if atomic.LoadInt32(&self.mining) == 1 {
// commit state root after all state transitions.
core.AccumulateRewards(work.state, header, uncles)
- work.state.SyncObjects()
- header.Root = work.state.Root()
+ header.Root = work.state.IntermediateRoot()
}
// create the new block whose nonce will be mined.