diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-05-03 16:01:06 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-05-03 16:01:06 +0800 |
commit | bcf2465b0b9c2aefcc7b79bdc24025f1497c08b1 (patch) | |
tree | 61a06be01095b78fdecadc68335ff5c8554c35dc /consensus | |
parent | c3dc01caf18addd8466bf8667dca2052ad1342f8 (diff) | |
download | dexon-bcf2465b0b9c2aefcc7b79bdc24025f1497c08b1.tar.gz dexon-bcf2465b0b9c2aefcc7b79bdc24025f1497c08b1.tar.zst dexon-bcf2465b0b9c2aefcc7b79bdc24025f1497c08b1.zip |
consensus/clique: fix overflow on recent signer check around genesis
Diffstat (limited to 'consensus')
-rw-r--r-- | consensus/clique/clique.go | 2 |
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 |