summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-22 22:02:24 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-22 22:02:24 +0100
commitbe699a7703efee2ce651e2c6c43cf15852d4d16e (patch)
tree8b2d6dc6b0d85ef62949b236c1b3d05d8ddbdefb /src/backend
parent76e52c42b97dbef12f3b96f10cf6af7bd5154fa2 (diff)
downloadmerchant-be699a7703efee2ce651e2c6c43cf15852d4d16e.tar.gz
merchant-be699a7703efee2ce651e2c6c43cf15852d4d16e.tar.bz2
merchant-be699a7703efee2ce651e2c6c43cf15852d4d16e.zip
terminate exchange interactions if we get an error
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-pay.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index 8a5b7993..dddac983 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -652,6 +652,23 @@ resume_pay_with_response (struct PayContext *pc,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Resuming /pay handling. HTTP status for our reply is %u.\n",
response_code);
+ for (unsigned int i = 0; i<pc->num_exchanges; i++)
+ {
+ struct ExchangeGroup *eg = pc->egs[i];
+
+ if (NULL != eg->fo)
+ {
+ TMH_EXCHANGES_keys4exchange_cancel (eg->fo);
+ eg->fo = NULL;
+ pc->pending_at_eg--;
+ }
+ if (NULL != eg->bdh)
+ {
+ TALER_EXCHANGE_batch_deposit_cancel (eg->bdh);
+ eg->bdh = NULL;
+ }
+ }
+ GNUNET_assert (0 == pc->pending_at_eg);
if (NULL != pc->timeout_task)
{
GNUNET_SCHEDULER_cancel (pc->timeout_task);