summaryrefslogtreecommitdiff
path: root/src/exchangedb/exchangedb_transactions.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-10-15 10:43:26 +0200
committerChristian Grothoff <christian@grothoff.org>2022-10-15 10:43:26 +0200
commiteebc030f6cf61d36b80e3273709fd9f254b155c3 (patch)
treef7e8c80b8aeabdc9067841da0b7be32a367a51f2 /src/exchangedb/exchangedb_transactions.c
parent5f333f817c0fe4d66d1223833f8b8f7f22ad174c (diff)
downloadexchange-eebc030f6cf61d36b80e3273709fd9f254b155c3.tar.gz
exchange-eebc030f6cf61d36b80e3273709fd9f254b155c3.tar.bz2
exchange-eebc030f6cf61d36b80e3273709fd9f254b155c3.zip
add logic to return information about purse refunds in coin histories
Diffstat (limited to 'src/exchangedb/exchangedb_transactions.c')
-rw-r--r--src/exchangedb/exchangedb_transactions.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/exchangedb/exchangedb_transactions.c b/src/exchangedb/exchangedb_transactions.c
index 60b95d6f6..f78393776 100644
--- a/src/exchangedb/exchangedb_transactions.c
+++ b/src/exchangedb/exchangedb_transactions.c
@@ -131,6 +131,26 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
}
deposit_fee = pos->details.purse_deposit->deposit_fee;
break;
+ case TALER_EXCHANGEDB_TT_PURSE_REFUND:
+ /* refunded += pos->refund_amount - pos->refund_fee */
+ if (0 >
+ TALER_amount_add (&refunded,
+ &refunded,
+ &pos->details.purse_refund->refund_amount))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ if (0 >
+ TALER_amount_add (&spent,
+ &spent,
+ &pos->details.purse_refund->refund_fee))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ have_refund = true;
+ break;
case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
/* spent += pos->amount_with_fee */
if (0 >