From e380dacced42aea8da8dfcadb67f6aca8cef43cd Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 14 Mar 2024 07:40:12 -0400 Subject: [PATCH] fix: loop needs to start at 1 so it's not outside the history range, else it tries to always create a date on boot --- renter/price_tracker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renter/price_tracker.go b/renter/price_tracker.go index 1d334f6..dbda7fa 100644 --- a/renter/price_tracker.go +++ b/renter/price_tracker.go @@ -212,7 +212,7 @@ func (p PriceTracker) importPrices() error { existingDateMap[d.Format("2006-01-02")] = true } - for i := 0; i < daysOfHistory; i++ { + for i := 1; i <= daysOfHistory; i++ { currentDate := startDate.AddDate(0, 0, i) dateKey := currentDate.Format("2006-01-02") if _, exists := existingDateMap[dateKey]; !exists {