consnesus/parlia: abort sealing when block in the same height has upd… (#1382)

This commit is contained in:
Leon 2023-03-29 17:36:24 +08:00 committed by GitHub
parent 75529530a2
commit af7f0dd30b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -893,6 +893,10 @@ func (p *Parlia) Seal(chain consensus.ChainHeaderReader, block *types.Block, res
log.Info("Received block process finished, abort block seal")
return
case <-time.After(time.Duration(processBackOffTime) * time.Second):
if chain.CurrentHeader().Number.Uint64() >= header.Number.Uint64() {
log.Info("Process backoff time exhausted, and current header has updated to abort this seal")
return
}
log.Info("Process backoff time exhausted, start to seal block")
}
}