Skip to content

Commit ed649ea

Browse files
committed
refactor: use new config variables
1 parent 37269b7 commit ed649ea

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

internal/certificatetransparency/ct-watcher.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,9 @@ func (w *worker) runWorker(ctx context.Context) error {
300300
return errCreatingClient
301301
}
302302

303-
validSavedCTIndexExists := config.AppConfig.General.ResumeFromCTIndexFile && w.ctIndex >= 0
304-
if !validSavedCTIndexExists || config.AppConfig.General.StartAtLatestSTH {
303+
// If recovery is enabled and the CT index is set, we start at the saved index. Otherwise we start at the latest STH.
304+
validSavedCTIndexExists := config.AppConfig.General.Recovery.Enabled && w.ctIndex >= 0
305+
if !validSavedCTIndexExists {
305306
sth, getSTHerr := jsonClient.GetSTH(ctx)
306307
if getSTHerr != nil {
307308
// TODO this can happen due to a 429 error. We should retry the request

0 commit comments

Comments
 (0)