miner, consensus/clique: avoid memory leak during block stasis (#23861)
This PR fixes a problem which arises on clique networks when there is a network stall. Previously, the worker packages were tracked, even if the sealing engine decided not to seal the block (due to clique rules about recent signing). These tracked-but-not-sealed blocks kept building up in memory. This PR changes the situation so the sealing engine instead returns an error, and the worker can thus un-track the package.
This commit is contained in:
committed by
GitHub
parent
8d7e6062ec
commit
476fb565ce
@ -593,6 +593,9 @@ func (w *worker) taskLoop() {
|
||||
|
||||
if err := w.engine.Seal(w.chain, task.block, w.resultCh, stopCh); err != nil {
|
||||
log.Warn("Block sealing failed", "err", err)
|
||||
w.pendingMu.Lock()
|
||||
delete(w.pendingTasks, sealHash)
|
||||
w.pendingMu.Unlock()
|
||||
}
|
||||
case <-w.exitCh:
|
||||
interrupt()
|
||||
|
Reference in New Issue
Block a user