Skip to content

Commit

Permalink
miner: not call commitNewWork if it's a side block (ethereum#16751)
Browse files Browse the repository at this point in the history
  • Loading branch information
markya0616 authored and kielbarry committed Jun 6, 2018
1 parent ac25724 commit faae913
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ func (self *worker) update() {

func (self *worker) wait() {
for {
mustCommitNewWork := true
for result := range self.recv {
atomic.AddInt32(&self.atWork, -1)

Expand All @@ -322,11 +321,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 (
Expand All @@ -341,10 +335,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()
}
}
}
}
Expand Down

0 comments on commit faae913

Please sign in to comment.