fix bug: case where this is the first refund

This commit is contained in:
Christian Grothoff 2020-08-14 13:07:53 +02:00
parent 18605e6c98
commit e8ea6bf1e7
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -377,13 +377,20 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
TALER_amount_ntoh (&amount, TALER_amount_ntoh (&amount,
&rh->depconf.refund_amount); &rh->depconf.refund_amount);
if (0 > if (have_refund)
TALER_amount_add (&rtotal,
&rtotal,
&amount))
{ {
GNUNET_break (0); if (0 >
return GNUNET_SYSERR; TALER_amount_add (&rtotal,
&rtotal,
&amount))
{
GNUNET_break (0);
return GNUNET_SYSERR;
}
}
else
{
rtotal = amount;
} }
} }
if (-1 == TALER_amount_cmp (&dtotal, if (-1 == TALER_amount_cmp (&dtotal,