mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
miner: not call commitNewWork if it's a side block
This commit is contained in:
parent
6cf0ab38bd
commit
950073646e
1 changed files with 0 additions and 10 deletions
|
|
@ -290,7 +290,6 @@ func (self *worker) update() {
|
||||||
|
|
||||||
func (self *worker) wait() {
|
func (self *worker) wait() {
|
||||||
for {
|
for {
|
||||||
mustCommitNewWork := true
|
|
||||||
for result := range self.recv {
|
for result := range self.recv {
|
||||||
atomic.AddInt32(&self.atWork, -1)
|
atomic.AddInt32(&self.atWork, -1)
|
||||||
|
|
||||||
|
|
@ -315,11 +314,6 @@ func (self *worker) wait() {
|
||||||
log.Error("Failed writing block to chain", "err", err)
|
log.Error("Failed writing block to chain", "err", err)
|
||||||
continue
|
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
|
// Broadcast the block and announce chain insertion event
|
||||||
self.mux.Post(core.NewMinedBlockEvent{Block: block})
|
self.mux.Post(core.NewMinedBlockEvent{Block: block})
|
||||||
var (
|
var (
|
||||||
|
|
@ -334,10 +328,6 @@ func (self *worker) wait() {
|
||||||
|
|
||||||
// Insert the block into the set of pending ones to wait for confirmations
|
// Insert the block into the set of pending ones to wait for confirmations
|
||||||
self.unconfirmed.Insert(block.NumberU64(), block.Hash())
|
self.unconfirmed.Insert(block.NumberU64(), block.Hash())
|
||||||
|
|
||||||
if mustCommitNewWork {
|
|
||||||
self.commitNewWork()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue