mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
consensus: use time.Until instead of time.Sub for easier to read
This commit is contained in:
parent
e85e21c932
commit
426a4e2aba
1 changed files with 1 additions and 1 deletions
|
|
@ -647,7 +647,7 @@ func (c *Clique) Seal(chain consensus.ChainHeaderReader, block *types.Block, res
|
|||
}
|
||||
}
|
||||
// Sweet, the protocol permits us to sign the block, wait for our time
|
||||
delay := time.Unix(int64(header.Time), 0).Sub(time.Now()) // nolint: gosimple
|
||||
delay := time.Until(time.Unix(int64(header.Time), 0))
|
||||
if header.Difficulty.Cmp(diffNoTurn) == 0 {
|
||||
// It's not our turn explicitly to sign, delay it a bit
|
||||
wiggle := time.Duration(len(snap.Signers)/2+1) * wiggleTime
|
||||
|
|
|
|||
Loading…
Reference in a new issue