summaryrefslogtreecommitdiff
path: root/src/pool.cc
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2017-10-30 05:45:25 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2017-10-30 05:45:25 +0100
commit0f70cca098542d49ef7a6180c576cd8be19f7994 (patch)
treec1206dd2dec27a299412a81c19fecca787232293 /src/pool.cc
parenta8a9c1a5284ddb3b497a6ade13901f04b3e33870 (diff)
downloadfork-ledger-0f70cca098542d49ef7a6180c576cd8be19f7994.tar.gz
fork-ledger-0f70cca098542d49ef7a6180c576cd8be19f7994.tar.bz2
fork-ledger-0f70cca098542d49ef7a6180c576cd8be19f7994.zip
Strip annotation before adding exchange value
Diffstat (limited to 'src/pool.cc')
-rw-r--r--src/pool.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pool.cc b/src/pool.cc
index 931a1708..e5f5ad36 100644
--- a/src/pool.cc
+++ b/src/pool.cc
@@ -262,6 +262,9 @@ commodity_pool_t::exchange(const amount_t& amount,
if (! cost.has_commodity())
per_unit_cost.clear_commodity();
+ if (cost.has_annotation())
+ per_unit_cost = per_unit_cost.strip_annotations(keep_details_t());
+
DEBUG("commodity.prices.add", "exchange: per-unit-cost = " << per_unit_cost);
// Do not record commodity exchanges where amount's commodity has a