From a83aa1f70ec66b468c3498251ea55f3ab89f6b0e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 22 Jul 2019 13:28:48 +0200 Subject: include new payback-refresh possibilities in coin history generation --- src/exchange/taler-exchange-httpd_db.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_db.c') 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 */ -- cgit v1.2.3