Skip to content

Commit 0029a86

Browse files
markya0616fjl
authored andcommitted
miner: not call commitNewWork if it's a side block (#16751)
1 parent 400332b commit 0029a86

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

miner/worker.go

-10
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ func (self *worker) update() {
297297

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

@@ -322,11 +321,6 @@ func (self *worker) wait() {
322321
log.Error("Failed writing block to chain", "err", err)
323322
continue
324323
}
325-
// check if canon block and write transactions
326-
if stat == core.CanonStatTy {
327-
// implicit by posting ChainHeadEvent
328-
mustCommitNewWork = false
329-
}
330324
// Broadcast the block and announce chain insertion event
331325
self.mux.Post(core.NewMinedBlockEvent{Block: block})
332326
var (
@@ -341,10 +335,6 @@ func (self *worker) wait() {
341335

342336
// Insert the block into the set of pending ones to wait for confirmations
343337
self.unconfirmed.Insert(block.NumberU64(), block.Hash())
344-
345-
if mustCommitNewWork {
346-
self.commitNewWork()
347-
}
348338
}
349339
}
350340
}

0 commit comments

Comments
 (0)