summaryrefslogtreecommitdiff
path: root/src/auditor/taler-helper-auditor-aggregation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-10-16 16:38:21 +0200
committerChristian Grothoff <christian@grothoff.org>2022-10-16 16:38:21 +0200
commit35e505f6bf983a5bffa4fd5d5ef4344c7da75a9f (patch)
tree79ac421cac8cd56b39cce2d6a5b17ab1220d0619 /src/auditor/taler-helper-auditor-aggregation.c
parent745981c680868eeebc303d8241267c5d0b1167c1 (diff)
downloadexchange-35e505f6bf983a5bffa4fd5d5ef4344c7da75a9f.tar.gz
exchange-35e505f6bf983a5bffa4fd5d5ef4344c7da75a9f.tar.bz2
exchange-35e505f6bf983a5bffa4fd5d5ef4344c7da75a9f.zip
add support for coin open-deposit and coin purse refunds to auditor logic
Diffstat (limited to 'src/auditor/taler-helper-auditor-aggregation.c')
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c
index c03dffe35..b15950630 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -593,7 +593,45 @@ check_transaction_history_for_deposit (
amount_with_fee);
break;
}
- }
+
+ case TALER_EXCHANGEDB_TT_PURSE_REFUND:
+ {
+ const struct TALER_Amount *amount_with_fee;
+
+ amount_with_fee = &tl->details.purse_refund->refund_amount;
+ fee_claimed = &tl->details.purse_refund->refund_fee;
+ TALER_ARL_amount_add (&refunds,
+ &refunds,
+ amount_with_fee);
+ TALER_ARL_amount_add (&expenditures,
+ &expenditures,
+ fee_claimed);
+ /* Check that the fees given in the transaction list and in dki match */
+ if (0 !=
+ TALER_amount_cmp (&issue->fees.refund,
+ fee_claimed))
+ {
+ /* Disagreement in fee structure between exchange and auditor! */
+ report_amount_arithmetic_inconsistency ("refund fee",
+ 0,
+ fee_claimed,
+ &issue->fees.refund,
+ 1);
+ }
+ break;
+ }
+
+ case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
+ {
+ const struct TALER_Amount *amount_with_fee;
+
+ amount_with_fee = &tl->details.reserve_open->coin_contribution;
+ TALER_ARL_amount_add (&expenditures,
+ &expenditures,
+ amount_with_fee);
+ break;
+ }
+ } /* switch (tl->type) */
} /* for 'tl' */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,