aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/exchangedb_transactions.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-24 00:52:33 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-24 00:52:33 +0200
commit6772037321c96aed73e898e3328286c219bcf7c8 (patch)
treef614b63f7788b38140433f7d960b7ddb98ee79b6 /src/exchangedb/exchangedb_transactions.c
parentde61e06eb164c5cb05778aba8e448a001462b783 (diff)
fix invariant check
Diffstat (limited to 'src/exchangedb/exchangedb_transactions.c')
-rw-r--r--src/exchangedb/exchangedb_transactions.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exchangedb/exchangedb_transactions.c b/src/exchangedb/exchangedb_transactions.c
index 93e4104e6..c1723958f 100644
--- a/src/exchangedb/exchangedb_transactions.c
+++ b/src/exchangedb/exchangedb_transactions.c
@@ -42,13 +42,13 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
struct TALER_Amount refunded;
struct TALER_Amount deposit_fee;
bool have_refund;
- bool have_deposit;
+ bool have_deposit_or_melt;
GNUNET_assert (GNUNET_OK ==
TALER_amount_get_zero (spent.currency,
&refunded));
have_refund = false;
- have_deposit = false;
+ have_deposit_or_melt = false;
for (struct TALER_EXCHANGEDB_TransactionList *pos = tl;
NULL != pos;
pos = pos->next)
@@ -57,7 +57,7 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
{
case TALER_EXCHANGEDB_TT_DEPOSIT:
/* spent += pos->amount_with_fee */
- have_deposit = true;
+ have_deposit_or_melt = true;
if (0 >
TALER_amount_add (&spent,
&spent,
@@ -70,6 +70,7 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
break;
case TALER_EXCHANGEDB_TT_MELT:
/* spent += pos->amount_with_fee */
+ have_deposit_or_melt = true;
if (0 >
TALER_amount_add (&spent,
&spent,
@@ -155,7 +156,7 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
GNUNET_break (0);
return GNUNET_SYSERR;
}
- GNUNET_break (have_deposit);
+ GNUNET_break (have_deposit_or_melt);
*ret = spent;
return GNUNET_OK;
}