summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-11-10 12:06:07 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:21 -0400
commit122af13d853193fab1cd2c73980c4dd196cd598b (patch)
treef84f438468c31163b1e000641d10984a94e6d173
parente984f50869daf85a22233005565444fc6c0880d7 (diff)
downloadfork-ledger-122af13d853193fab1cd2c73980c4dd196cd598b.tar.gz
fork-ledger-122af13d853193fab1cd2c73980c4dd196cd598b.tar.bz2
fork-ledger-122af13d853193fab1cd2c73980c4dd196cd598b.zip
Added a safety check to see if moment is less than date.
-rw-r--r--quotes.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/quotes.cc b/quotes.cc
index 2c1f3723..d3f84439 100644
--- a/quotes.cc
+++ b/quotes.cc
@@ -29,7 +29,8 @@ void quotes_by_script::operator()(commodity_t& commodity,
if ((commodity.history &&
std::difftime(now, commodity.history->last_lookup) < pricing_leeway) ||
std::difftime(now, last) < pricing_leeway ||
- (price && std::difftime(moment, date) <= pricing_leeway))
+ (price && std::difftime(moment, date) > 0 &&
+ std::difftime(moment, date) <= pricing_leeway))
return;
using namespace std;