From b0f12c600c8080d11d8f514aa7d4149323da6803 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 31 Oct 2009 03:07:15 -0400 Subject: Added a --forecast-years option This sets how many years of forecasting Ledger will do before it terminates the attempt. --- src/filters.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/filters.cc') diff --git a/src/filters.cc b/src/filters.cc index 814cf276..fe8761a5 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -871,9 +871,11 @@ void forecast_posts::flush() date_t next = *(*least).first.next; assert(next > begin); - if ((next - last).days() > 365 * 5) { + if (static_cast((next - last).days()) > + static_cast(365U) * forecast_years) { DEBUG("filters.forecast", - "Forecast transaction exceeds 5 years beyond today"); + "Forecast transaction exceeds " << forecast_years + << " years beyond today"); pending_posts.erase(least); continue; } -- cgit v1.2.3