mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
gofmt, bypass signed recently for epoch block
This commit is contained in:
parent
555a9bc328
commit
75d729efde
1 changed files with 15 additions and 9 deletions
|
|
@ -575,10 +575,13 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p
|
|||
if recent == signer {
|
||||
// Signer is among recents, only fail if the current block doesn't shift it out
|
||||
if limit := uint64(len(masternodes)/2 + 1); seen > number-limit {
|
||||
// Only take into account the non-epoch blocks
|
||||
if number%c.config.Epoch != 0 {
|
||||
return errUnauthorized
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -752,6 +755,8 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
|
|||
if recent == signer {
|
||||
// Signer is among recents, only wait if the current block doesn't shift it out
|
||||
if limit := uint64(len(masternodes)/2 + 1); number < limit || seen > number-limit {
|
||||
// Only take into account the non-epoch blocks
|
||||
if number%c.config.Epoch != 0 {
|
||||
log.Info("Debugging", "len(masternodes)", len(masternodes), "number", number, "limit", limit, "seen", seen, "recent", recent.String(), "snap.Recents", snap.Recents)
|
||||
log.Info("Signed recently, must wait for others")
|
||||
<-stop
|
||||
|
|
@ -759,6 +764,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sweet, the protocol permits us to sign the block, wait for our time
|
||||
delay := time.Unix(header.Time.Int64(), 0).Sub(time.Now()) // nolint: gosimple
|
||||
if header.Difficulty.Cmp(diffNoTurn) == 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue