summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-15 04:47:32 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-15 04:58:53 -0500
commit610a3e170994dc3cd3ae0dc989a49e4e7c7fdadf (patch)
treedb4a99b9f5f41047c0c4632452eb944c93a7f07d /src/commodity.cc
parentd9fc09097d3ea290a4bdf0c9b46c8ead3e48043c (diff)
downloadfork-ledger-610a3e170994dc3cd3ae0dc989a49e4e7c7fdadf.tar.gz
fork-ledger-610a3e170994dc3cd3ae0dc989a49e4e7c7fdadf.tar.bz2
fork-ledger-610a3e170994dc3cd3ae0dc989a49e4e7c7fdadf.zip
Don't map_prices if price commodity matches source
Fixes #680
Diffstat (limited to 'src/commodity.cc')
-rw-r--r--src/commodity.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/commodity.cc b/src/commodity.cc
index 8f0dc100..0dad9a1a 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -72,7 +72,8 @@ void commodity_t::remove_price(const datetime_t& date, commodity_t& commodity)
void commodity_t::map_prices(function<void(datetime_t, const amount_t&)> fn,
const datetime_t& moment,
- const datetime_t& _oldest)
+ const datetime_t& _oldest,
+ bool bidirectionally)
{
datetime_t when;
if (! moment.is_not_a_date_time())
@@ -82,7 +83,8 @@ void commodity_t::map_prices(function<void(datetime_t, const amount_t&)> fn,
else
when = CURRENT_TIME();
- pool().commodity_price_history.map_prices(fn, *this, when, _oldest);
+ pool().commodity_price_history.map_prices(fn, *this, when, _oldest,
+ bidirectionally);
}
optional<price_point_t>