summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-14 13:07:53 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-14 13:07:53 +0200
commite8ea6bf1e7d9f22a964a9e7e13bc68debb0a7954 (patch)
treeeb30289a4fde13340f0ac91c0d411d6362c28811
parent18605e6c9856b234afd5fcad1eab7b7692f786e7 (diff)
downloadexchange-e8ea6bf1e7d9f22a964a9e7e13bc68debb0a7954.tar.gz
exchange-e8ea6bf1e7d9f22a964a9e7e13bc68debb0a7954.tar.bz2
exchange-e8ea6bf1e7d9f22a964a9e7e13bc68debb0a7954.zip
fix bug: case where this is the first refund
-rw-r--r--src/lib/exchange_api_refund.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c
index ee634e7f..55f71757 100644
--- a/src/lib/exchange_api_refund.c
+++ b/src/lib/exchange_api_refund.c
@@ -377,13 +377,20 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
TALER_amount_ntoh (&amount,
&rh->depconf.refund_amount);
- if (0 >
- TALER_amount_add (&rtotal,
- &rtotal,
- &amount))
+ if (have_refund)
{
- GNUNET_break (0);
- return GNUNET_SYSERR;
+ if (0 >
+ TALER_amount_add (&rtotal,
+ &rtotal,
+ &amount))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ }
+ else
+ {
+ rtotal = amount;
}
}
if (-1 == TALER_amount_cmp (&dtotal,