From b90ec255221a90f34d313b7f3433e7d686a7b1c9 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 28 Jun 2009 15:57:49 +0100 Subject: Reject downloaded quotes price in the wrong commodity --- src/commodity.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/commodity.cc b/src/commodity.cc index 900fe07d..37f0b573 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -407,7 +407,10 @@ commodity_t::check_for_updated_price(const optional& point, "attempting to download a more current quote..."); if (optional quote = parent().get_commodity_quote(*this, in_terms_of)) { - return quote; + if (! in_terms_of || + (quote->price.has_commodity() && + quote->price.commodity() == *in_terms_of)) + return quote; } } } -- cgit v1.2.3