瀏覽代碼

consensus/clique: fix overflow on recent signer check around genesis

Péter Szilágyi 8 年之前
父節點
當前提交
bcf2465b0b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      consensus/clique/clique.go

+ 1 - 1
consensus/clique/clique.go

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