summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-28 15:57:49 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-28 15:57:49 +0100
commitb90ec255221a90f34d313b7f3433e7d686a7b1c9 (patch)
tree95b06cfb30a4b2c40d4881dafa6e95ef64b2790c /src/commodity.cc
parente8f315f00d0874e2afdee45525c4ce96d0768336 (diff)
downloadfork-ledger-b90ec255221a90f34d313b7f3433e7d686a7b1c9.tar.gz
fork-ledger-b90ec255221a90f34d313b7f3433e7d686a7b1c9.tar.bz2
fork-ledger-b90ec255221a90f34d313b7f3433e7d686a7b1c9.zip
Reject downloaded quotes price in the wrong commodity
Diffstat (limited to 'src/commodity.cc')
-rw-r--r--src/commodity.cc5
1 files changed, 4 insertions, 1 deletions
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<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;
}
}
}