Reject downloaded quotes price in the wrong commodity

This commit is contained in:
John Wiegley 2009-06-28 15:57:49 +01:00
parent e8f315f00d
commit b90ec25522

View file

@ -407,7 +407,10 @@ commodity_t::check_for_updated_price(const optional<price_point_t>& point,
"attempting to download a more current quote...");
if (optional<price_point_t> 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;
}
}
}