Skip to content

Commit aee70ae

Browse files
committed
consensus: fix megacheck warnings
1 parent b159cdd commit aee70ae

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎consensus/clique/clique.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
619619
}
620620
}
621621
// Sweet, the protocol permits us to sign the block, wait for our time
622-
delay := time.Unix(header.Time.Int64(), 0).Sub(time.Now())
622+
delay := time.Until(time.Unix(header.Time.Int64(), 0))
623623
if header.Difficulty.Cmp(diffNoTurn) == 0 {
624624
// It's not our turn explicitly to sign, delay it a bit
625625
wiggle := time.Duration(len(snap.Signers)/2+1) * wiggleTime

‎consensus/clique/snapshot.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
229229
// Tally up the new vote from the signer
230230
var authorize bool
231231
switch {
232-
case bytes.Compare(header.Nonce[:], nonceAuthVote) == 0:
232+
case bytes.Equal(header.Nonce[:], nonceAuthVote):
233233
authorize = true
234-
case bytes.Compare(header.Nonce[:], nonceDropVote) == 0:
234+
case bytes.Equal(header.Nonce[:], nonceDropVote):
235235
authorize = false
236236
default:
237237
return nil, errInvalidVote

0 commit comments

Comments
 (0)