aboutsummaryrefslogtreecommitdiffstats
path: root/consensus/clique
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-05-03 16:01:06 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-05-03 16:01:06 +0800
commitbcf2465b0b9c2aefcc7b79bdc24025f1497c08b1 (patch)
tree61a06be01095b78fdecadc68335ff5c8554c35dc /consensus/clique
parentc3dc01caf18addd8466bf8667dca2052ad1342f8 (diff)
downloaddexon-bcf2465b0b9c2aefcc7b79bdc24025f1497c08b1.tar.gz
dexon-bcf2465b0b9c2aefcc7b79bdc24025f1497c08b1.tar.zst
dexon-bcf2465b0b9c2aefcc7b79bdc24025f1497c08b1.zip
consensus/clique: fix overflow on recent signer check around genesis
Diffstat (limited to 'consensus/clique')
-rw-r--r--consensus/clique/clique.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go
index 8619bd1d8..675333bcc 100644
--- a/consensus/clique/clique.go
+++ b/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