diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 8335d5cc3e..caea25bb92 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -718,9 +718,10 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch if err != nil { return nil, err } + masternodes := []common.Address{} if _, authorized := snap.Signers[signer]; !authorized { valid := false - masternodes := c.GetMasternodes(chain, header) + masternodes = c.GetMasternodes(chain, header) for _, m := range masternodes { if m == signer { valid = true @@ -735,7 +736,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 doesn't shift it out - if limit := uint64(len(snap.Signers)/2 + 1); number < limit || seen > number-limit { + if limit := uint64(len(masternodes)/2 + 1); number < limit || seen > number-limit { log.Info("Signed recently, must wait for others") <-stop return nil, nil