Skip to content
Snippets Groups Projects
Commit 8f0121d7 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

fixed the period of first ID generation

parent 3fd7690b
Branches
Tags
No related merge requests found
...@@ -151,7 +151,9 @@ func generateIdentities(protoIds []ephemeral.ProtoIdentity, ...@@ -151,7 +151,9 @@ func generateIdentities(protoIds []ephemeral.ProtoIdentity,
// then the current time is stored // then the current time is stored
func checkTimestampStore(session *storage.Session) error { func checkTimestampStore(session *storage.Session) error {
if _, err := session.Get(TimestampKey); err != nil { if _, err := session.Get(TimestampKey); err != nil {
now, err := marshalTimestamp(time.Unix(0, 0)) // only generate from the last hour because this is a new id, it
// couldn't receive messages yet
now, err := marshalTimestamp(time.Now().Add(-1*time.Hour))
if err != nil { if err != nil {
return errors.Errorf("Could not marshal new timestamp for storage: %v", err) return errors.Errorf("Could not marshal new timestamp for storage: %v", err)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment