@@ -99,10 +99,10 @@ var (
99
99
// their extra-data fields.
100
100
errExtraSigners = errors .New ("non-checkpoint block contains extra signer list" )
101
101
102
- // drrInvalidCheckpointSigners is returned if a checkpoint block contains an
102
+ // errInvalidCheckpointSigners is returned if a checkpoint block contains an
103
103
// invalid list of signers (i.e. non divisible by 20 bytes, or not the correct
104
104
// ones).
105
- drrInvalidCheckpointSigners = errors .New ("invalid signer list on checkpoint block" )
105
+ errInvalidCheckpointSigners = errors .New ("invalid signer list on checkpoint block" )
106
106
107
107
// errInvalidMixDigest is returned if a block's mix digest is non-zero.
108
108
errInvalidMixDigest = errors .New ("non-zero mix digest" )
@@ -297,7 +297,7 @@ func (c *Clique) verifyHeader(chain consensus.ChainReader, header *types.Header,
297
297
return errExtraSigners
298
298
}
299
299
if checkpoint && signersBytes % common .AddressLength != 0 {
300
- return drrInvalidCheckpointSigners
300
+ return errInvalidCheckpointSigners
301
301
}
302
302
// Ensure that the mix digest is zero as we don't have fork protection currently
303
303
if header .MixDigest != (common.Hash {}) {
@@ -353,7 +353,7 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainReader, header *type
353
353
}
354
354
extraSuffix := len (header .Extra ) - extraSeal
355
355
if ! bytes .Equal (header .Extra [extraVanity :extraSuffix ], signers ) {
356
- return drrInvalidCheckpointSigners
356
+ return errInvalidCheckpointSigners
357
357
}
358
358
}
359
359
// All basic checks passed, verify the seal and return
@@ -467,7 +467,6 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p
467
467
if err != nil {
468
468
return err
469
469
}
470
- c .recents .Add (snap .Hash , snap )
471
470
472
471
// Resolve the authorization key and check against signers
473
472
signer , err := ecrecover (header , c .signatures )
@@ -479,13 +478,13 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p
479
478
}
480
479
for seen , recent := range snap .Recents {
481
480
if recent == signer {
482
- // Signer is among recents, only fail if the current block doens 't shift it out
481
+ // Signer is among recents, only fail if the current block doesn 't shift it out
483
482
if limit := uint64 (len (snap .Signers )/ 2 + 1 ); seen > number - limit {
484
483
return errUnauthorized
485
484
}
486
485
}
487
486
}
488
- // Ensure that the difficulty corresponts to the turn-ness of the signer
487
+ // Ensure that the difficulty corresponds to the turn-ness of the signer
489
488
inturn := snap .inturn (header .Number .Uint64 (), signer )
490
489
if inturn && header .Difficulty .Cmp (diffInTurn ) != 0 {
491
490
return errInvalidDifficulty
@@ -604,7 +603,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
604
603
// If we're amongst the recent signers, wait for the next block
605
604
for seen , recent := range snap .Recents {
606
605
if recent == signer {
607
- // Signer is among recents, only wait if the current block doens 't shift it out
606
+ // Signer is among recents, only wait if the current block doesn 't shift it out
608
607
if limit := uint64 (len (snap .Signers )/ 2 + 1 ); number < limit || seen > number - limit {
609
608
log .Info ("Signed recently, must wait for others" )
610
609
<- stop
0 commit comments