Avoid calling get-entries when range is invalid (end < begin)

end < begin can arise if we've rounded down end to avoid downloading a
partial tile, but the log position is already within the partial tile
(which can happen with a brand new log and -start_at_end).
This commit is contained in:
Andrew Ayer 2025-05-06 14:58:23 -04:00
parent a6af6c54ba
commit 71b296141e
1 changed files with 6 additions and 4 deletions

View File

@ -418,11 +418,13 @@ func downloadWorker(ctx context.Context, config *Config, ctlog *loglist.Log, cli
case batch = <-batchesIn: case batch = <-batchesIn:
} }
entries, err := getEntriesFull(ctx, client, batch.begin, batch.end) if batch.end > batch.begin {
if err != nil { entries, err := getEntriesFull(ctx, client, batch.begin, batch.end)
return err if err != nil {
return err
}
batch.entries = entries
} }
batch.entries = entries
select { select {
case <-ctx.Done(): case <-ctx.Done():