aboutsummaryrefslogtreecommitdiff
path: root/pkg/db/trillian.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2021-12-28 21:32:38 +0100
committerRasmus Dahlberg <rasmus@mullvad.net>2021-12-28 21:32:38 +0100
commit601d2ee04840d24fe13e5ec54ae09f2a623f3d02 (patch)
tree2ee254223b4aa4b3c52cc0c056c5d2dc45c385cf /pkg/db/trillian.go
parent04ca3b71764c0a958338ddacb92c2f474c5f4e78 (diff)
db: Fix error prone timestamp configurationv0.3.4
The timestamp for the latest tree head is now set based on the current UNIX time. This means that there is no longer any reliance on Trillian to move the timestamp forward every 5 minutes, just set -interval=300s.
Diffstat (limited to 'pkg/db/trillian.go')
-rw-r--r--pkg/db/trillian.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/db/trillian.go b/pkg/db/trillian.go
index ab57db6..25b2fb3 100644
--- a/pkg/db/trillian.go
+++ b/pkg/db/trillian.go
@@ -3,6 +3,7 @@ package db
import (
"context"
"fmt"
+ "time"
"git.sigsum.org/sigsum-lib-go/pkg/requests"
"git.sigsum.org/sigsum-lib-go/pkg/types"
@@ -173,7 +174,7 @@ func (c *TrillianClient) GetLeaves(ctx context.Context, req *requests.Leaves) (*
func treeHeadFromLogRoot(lr *trillianTypes.LogRootV1) *types.TreeHead {
th := types.TreeHead{
- Timestamp: uint64(lr.TimestampNanos / 1000 / 1000 / 1000),
+ Timestamp: uint64(time.Now().Unix()),
TreeSize: uint64(lr.TreeSize),
}
copy(th.RootHash[:], lr.RootHash)