diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-04 05:22:30 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-05 05:03:52 -0600 |
commit | 5d8cb30774cf630cddd26407202c1cad8568bbef (patch) | |
tree | c97ae3166261d9a0feb78144d380d8cc78f743dd /src/commodity.cc | |
parent | e9108783122ae4d775046ced646b14552f1e184d (diff) | |
download | fork-ledger-5d8cb30774cf630cddd26407202c1cad8568bbef.tar.gz fork-ledger-5d8cb30774cf630cddd26407202c1cad8568bbef.tar.bz2 fork-ledger-5d8cb30774cf630cddd26407202c1cad8568bbef.zip |
Implemented first cut at price conversion logic
Diffstat (limited to 'src/commodity.cc')
-rw-r--r-- | src/commodity.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index a01847c5..5e55db31 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -96,7 +96,9 @@ commodity_t::find_price(const optional<commodity_t&>& commodity, target = *pool().default_commodity; optional<price_point_t> point = - pool().commodity_price_history.find_price(*this, when, oldest, target); + target ? + pool().commodity_price_history.find_price(*this, *target, when, oldest) : + pool().commodity_price_history.find_price(*this, when, oldest); if (pair) { if (base->price_map.size() > base_t::max_price_map_size) { |