From 950073646e4c72b4b7b1c0650d50e1da6eaf4afd Mon Sep 17 00:00:00 2001 From: "mark.lin" Date: Fri, 18 May 2018 13:43:30 +0800 Subject: [PATCH] miner: not call commitNewWork if it's a side block --- miner/worker.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 48b0b27652b7..690e92aee02f 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -290,7 +290,6 @@ func (self *worker) update() { func (self *worker) wait() { for { - mustCommitNewWork := true for result := range self.recv { atomic.AddInt32(&self.atWork, -1) @@ -315,11 +314,6 @@ func (self *worker) wait() { log.Error("Failed writing block to chain", "err", err) continue } - // check if canon block and write transactions - if stat == core.CanonStatTy { - // implicit by posting ChainHeadEvent - mustCommitNewWork = false - } // Broadcast the block and announce chain insertion event self.mux.Post(core.NewMinedBlockEvent{Block: block}) var ( @@ -334,10 +328,6 @@ func (self *worker) wait() { // Insert the block into the set of pending ones to wait for confirmations self.unconfirmed.Insert(block.NumberU64(), block.Hash()) - - if mustCommitNewWork { - self.commitNewWork() - } } } }