summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_db.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-07-22 13:28:48 +0200
committerChristian Grothoff <christian@grothoff.org>2019-07-22 13:28:48 +0200
commita83aa1f70ec66b468c3498251ea55f3ab89f6b0e (patch)
tree0356f217d55c5b9457f797e144d6c8000677e6b7 /src/exchange/taler-exchange-httpd_db.c
parentc0c80d4a6709fbf1a92417a66635b2b5b5703da7 (diff)
downloadexchange-a83aa1f70ec66b468c3498251ea55f3ab89f6b0e.tar.gz
exchange-a83aa1f70ec66b468c3498251ea55f3ab89f6b0e.tar.bz2
exchange-a83aa1f70ec66b468c3498251ea55f3ab89f6b0e.zip
include new payback-refresh possibilities in coin history generation
Diffstat (limited to 'src/exchange/taler-exchange-httpd_db.c')
-rw-r--r--src/exchange/taler-exchange-httpd_db.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c
index 1f47f8e1a..3b9dc36b5 100644
--- a/src/exchange/taler-exchange-httpd_db.c
+++ b/src/exchange/taler-exchange-httpd_db.c
@@ -168,8 +168,8 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
// FIXME: maybe move to another module, i.e. exchangedb???
int
TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionList *tl,
- const struct TALER_Amount *off,
- struct TALER_Amount *ret)
+ const struct TALER_Amount *off,
+ struct TALER_Amount *ret)
{
struct TALER_Amount spent = *off;
struct TALER_Amount refunded;
@@ -222,6 +222,17 @@ TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionLis
return GNUNET_SYSERR;
}
break;
+ case TALER_EXCHANGEDB_TT_OLD_COIN_PAYBACK:
+ /* refunded += pos->value */
+ if (GNUNET_OK !=
+ TALER_amount_add (&refunded,
+ &refunded,
+ &pos->details.old_coin_payback->value))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ break;
case TALER_EXCHANGEDB_TT_PAYBACK:
/* spent += pos->value */
if (GNUNET_OK !=
@@ -233,6 +244,17 @@ TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionLis
return GNUNET_SYSERR;
}
break;
+ case TALER_EXCHANGEDB_TT_PAYBACK_REFRESH:
+ /* spent += pos->value */
+ if (GNUNET_OK !=
+ TALER_amount_add (&spent,
+ &spent,
+ &pos->details.payback_refresh->value))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ break;
}
}
/* spent = spent - refunded */