mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 05:46:32 +00:00
Convert explicit zero comparison to a method. (#8475)
Fixes #8472. I didn't see any other obvious cases of us doing this (although we do return zeroes in other places alongside errors, which is fine).
This commit is contained in:
@@ -279,8 +279,7 @@ func checkRequiredHeaderFields(h *types.SignedHeader) error {
|
||||
return errors.New("height in trusted header must be set (non zero")
|
||||
}
|
||||
|
||||
zeroTime := time.Time{}
|
||||
if h.Time == zeroTime {
|
||||
if h.Time.IsZero() {
|
||||
return errors.New("time in trusted header must be set")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user