Refactor internals of client time (#134)
This commit is contained in:
parent
039f757e93
commit
7380f7391f
2 changed files with 0 additions and 4 deletions
|
|
@ -1,13 +1,10 @@
|
||||||
// Package crypto provides a high-level API for common OpenPGP functionality.
|
// Package crypto provides a high-level API for common OpenPGP functionality.
|
||||||
package crypto
|
package crypto
|
||||||
|
|
||||||
import "time"
|
|
||||||
|
|
||||||
// GopenPGP is used as a "namespace" for many of the functions in this package.
|
// GopenPGP is used as a "namespace" for many of the functions in this package.
|
||||||
// It is a struct that keeps track of time skew between server and client.
|
// It is a struct that keeps track of time skew between server and client.
|
||||||
type GopenPGP struct {
|
type GopenPGP struct {
|
||||||
latestServerTime int64
|
latestServerTime int64
|
||||||
latestClientTime time.Time
|
|
||||||
generationOffset int64
|
generationOffset int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import (
|
||||||
func UpdateTime(newTime int64) {
|
func UpdateTime(newTime int64) {
|
||||||
if newTime > pgp.latestServerTime {
|
if newTime > pgp.latestServerTime {
|
||||||
pgp.latestServerTime = newTime
|
pgp.latestServerTime = newTime
|
||||||
pgp.latestClientTime = time.Now()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue