From af7f0dd30b80415c27e4786940476f05b033eb0b Mon Sep 17 00:00:00 2001 From: Leon <316032931@qq.com> Date: Wed, 29 Mar 2023 17:36:24 +0800 Subject: [PATCH] =?UTF-8?q?consnesus/parlia:=20abort=20sealing=20when=20bl?= =?UTF-8?q?ock=20in=20the=20same=20height=20has=20upd=E2=80=A6=20(#1382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consensus/parlia/parlia.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 3fc94e834..7a483a8fb 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -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") } }