diff --git a/crypto/time.go b/crypto/time.go index eeb91c9..85b0fff 100644 --- a/crypto/time.go +++ b/crypto/time.go @@ -7,8 +7,10 @@ import ( // UpdateTime updates cached time. func UpdateTime(newTime int64) { - pgp.latestServerTime = newTime - pgp.latestClientTime = time.Now() + if newTime > pgp.latestServerTime { + pgp.latestServerTime = newTime + pgp.latestClientTime = time.Now() + } } // GetUnixTime gets latest cached time.