aboutsummaryrefslogtreecommitdiff
path: root/internal/monitor/tail.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rgdd@glasklarteknik.se>2025-01-05 14:34:04 +0100
committerRasmus Dahlberg <rgdd@glasklarteknik.se>2025-01-05 14:34:04 +0100
commita7cc687c7bab91b9e525d9b91dc9d358afca5a28 (patch)
treed0e4d01097b51737858414f04e41d7ceca9eabf3 /internal/monitor/tail.go
parent108932cab926cf9743df7f9eaf383104130e9377 (diff)
fix: Don't accept timestamps that shrink
Diffstat (limited to 'internal/monitor/tail.go')
-rw-r--r--internal/monitor/tail.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/monitor/tail.go b/internal/monitor/tail.go
index 98ce4e0..2ad8135 100644
--- a/internal/monitor/tail.go
+++ b/internal/monitor/tail.go
@@ -136,6 +136,9 @@ func (t *tail) nextConsistentState(ctx context.Context, state State) (State, err
if err != nil {
return State{}, fmt.Errorf("%s: get-sth: %v", t.checker.BaseURI(), err)
}
+ if sth.Timestamp < state.Timestamp {
+ return State{}, fmt.Errorf("%s: get-sth: timestamp is shrinking", t.checker.BaseURI())
+ }
sth.LogID = state.SignedTreeHead.LogID
oldSize := state.TreeSize
oldRoot := state.SHA256RootHash