Skip to content

Commit 02fa3e3

Browse files
authored
Merge pull request #14411 from karalabe/clique-double-sign
consensus/clique: fix overflow on recent signer check around genesis
2 parents a8eafcd + bcf2465 commit 02fa3e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

consensus/clique/clique.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
599599
for seen, recent := range snap.Recents {
600600
if recent == signer {
601601
// Signer is among recents, only wait if the current block doens't shift it out
602-
if limit := uint64(len(snap.Signers)/2 + 1); seen > number-limit {
602+
if limit := uint64(len(snap.Signers)/2 + 1); number < limit || seen > number-limit {
603603
log.Info("Signed recently, must wait for others")
604604
<-stop
605605
return nil, nil

0 commit comments

Comments
 (0)