this invariant does not actually hold, i.e. if there is a /recoup request for a coin we never saw
This commit is contained in:
parent
af0a2c32a3
commit
7cf67b3094
@ -42,13 +42,11 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
|
|||||||
struct TALER_Amount refunded;
|
struct TALER_Amount refunded;
|
||||||
struct TALER_Amount deposit_fee;
|
struct TALER_Amount deposit_fee;
|
||||||
bool have_refund;
|
bool have_refund;
|
||||||
bool have_deposit_or_melt_or_recoup;
|
|
||||||
|
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_amount_get_zero (spent.currency,
|
TALER_amount_get_zero (spent.currency,
|
||||||
&refunded));
|
&refunded));
|
||||||
have_refund = false;
|
have_refund = false;
|
||||||
have_deposit_or_melt_or_recoup = false;
|
|
||||||
for (struct TALER_EXCHANGEDB_TransactionList *pos = tl;
|
for (struct TALER_EXCHANGEDB_TransactionList *pos = tl;
|
||||||
NULL != pos;
|
NULL != pos;
|
||||||
pos = pos->next)
|
pos = pos->next)
|
||||||
@ -57,7 +55,6 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
|
|||||||
{
|
{
|
||||||
case TALER_EXCHANGEDB_TT_DEPOSIT:
|
case TALER_EXCHANGEDB_TT_DEPOSIT:
|
||||||
/* spent += pos->amount_with_fee */
|
/* spent += pos->amount_with_fee */
|
||||||
have_deposit_or_melt_or_recoup = true;
|
|
||||||
if (0 >
|
if (0 >
|
||||||
TALER_amount_add (&spent,
|
TALER_amount_add (&spent,
|
||||||
&spent,
|
&spent,
|
||||||
@ -70,7 +67,6 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
|
|||||||
break;
|
break;
|
||||||
case TALER_EXCHANGEDB_TT_MELT:
|
case TALER_EXCHANGEDB_TT_MELT:
|
||||||
/* spent += pos->amount_with_fee */
|
/* spent += pos->amount_with_fee */
|
||||||
have_deposit_or_melt_or_recoup = true;
|
|
||||||
if (0 >
|
if (0 >
|
||||||
TALER_amount_add (&spent,
|
TALER_amount_add (&spent,
|
||||||
&spent,
|
&spent,
|
||||||
@ -112,7 +108,6 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TALER_EXCHANGEDB_TT_RECOUP:
|
case TALER_EXCHANGEDB_TT_RECOUP:
|
||||||
have_deposit_or_melt_or_recoup = true;
|
|
||||||
/* spent += pos->value */
|
/* spent += pos->value */
|
||||||
if (0 >
|
if (0 >
|
||||||
TALER_amount_add (&spent,
|
TALER_amount_add (&spent,
|
||||||
@ -157,7 +152,6 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals (
|
|||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_break (have_deposit_or_melt_or_recoup);
|
|
||||||
*ret = spent;
|
*ret = spent;
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
@ -675,7 +675,7 @@ run (void *cls,
|
|||||||
"recoup-reveal-coin-1b",
|
"recoup-reveal-coin-1b",
|
||||||
"recoup-melt-coin-1b",
|
"recoup-melt-coin-1b",
|
||||||
"EUR:5"),
|
"EUR:5"),
|
||||||
#if FIXME
|
#if 1
|
||||||
/* "over-spend" 10 EUR recoup-refreshed coin */
|
/* "over-spend" 10 EUR recoup-refreshed coin */
|
||||||
TALER_TESTING_cmd_deposit ("recoup-refresh-deposit-failing",
|
TALER_TESTING_cmd_deposit ("recoup-refresh-deposit-failing",
|
||||||
"recoup-withdraw-coin-1b",
|
"recoup-withdraw-coin-1b",
|
||||||
|
Loading…
Reference in New Issue
Block a user