diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-02-16 10:32:50 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-02-16 10:32:50 +0100 |
commit | 7f612c06514d99cb37806a52eb95470fe4b46e9a (patch) | |
tree | 7005f2330cb9ede848590a82e33e0941a8a4b0bb /src/backend/taler-merchant-httpd_post-orders-ID-pay.c | |
parent | d5461aa6bc083dba4e79ed44c2e0d087f3607dec (diff) | |
download | merchant-7f612c06514d99cb37806a52eb95470fe4b46e9a.tar.gz merchant-7f612c06514d99cb37806a52eb95470fe4b46e9a.tar.bz2 merchant-7f612c06514d99cb37806a52eb95470fe4b46e9a.zip |
try to fix #8412
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-pay.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 16 |
1 files changed, 5 insertions, 11 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 b60e2241..0efc03a6 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -667,6 +667,7 @@ resume_pay_with_response (struct PayContext *pc, { TALER_EXCHANGE_batch_deposit_cancel (eg->bdh); eg->bdh = NULL; + pc->pending_at_eg--; } } GNUNET_assert (0 == pc->pending_at_eg); @@ -1152,11 +1153,11 @@ batch_deposit_cb ( struct PayContext *pc = eg->pc; eg->bdh = NULL; + pc->pending_at_eg--; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Batch deposit completed with status %u\n", dr->hr.http_status); GNUNET_assert (GNUNET_YES == pc->suspended); - pc->pending_at_eg--; switch (dr->hr.http_status) { case MHD_HTTP_OK: @@ -1255,6 +1256,7 @@ process_pay_with_keys ( unsigned int group_size; eg->fo = NULL; + pc->pending_at_eg--; GNUNET_SCHEDULER_begin_async_scope (&hc->async_scope_id); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Processing payment with exchange %s\n", @@ -1263,7 +1265,6 @@ process_pay_with_keys ( if (NULL == keys) { GNUNET_break_op (0); - pc->pending_at_eg--; resume_pay_with_error ( pc, TALER_EC_MERCHANT_GENERIC_EXCHANGE_TIMEOUT, @@ -1278,7 +1279,6 @@ process_pay_with_keys ( if (eg->tried_force_keys) { GNUNET_break_op (0); - pc->pending_at_eg--; resume_pay_with_error ( pc, TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_WIRE_METHOD_UNSUPPORTED, @@ -1296,7 +1296,6 @@ process_pay_with_keys ( { if (eg->tried_force_keys) { - pc->pending_at_eg--; GNUNET_break_op (0); resume_pay_with_error ( pc, @@ -1334,7 +1333,6 @@ process_pay_with_keys ( if (eg->tried_force_keys) { GNUNET_break_op (0); - pc->pending_at_eg--; resume_pay_with_response ( pc, MHD_HTTP_BAD_REQUEST, @@ -1360,7 +1358,6 @@ process_pay_with_keys ( { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Denomination key offered by client has expired for deposits\n"); - pc->pending_at_eg--; resume_pay_with_response ( pc, MHD_HTTP_GONE, @@ -1409,7 +1406,6 @@ AGE_FAIL: if (0 < code) { GNUNET_break_op (0); - pc->pending_at_eg--; GNUNET_free (dc->age_commitment.keys); resume_pay_with_response ( pc, @@ -1434,7 +1430,6 @@ AGE_FAIL: * with a coin that has age restriction enabled. We lack the hash * of the age commitment in this case in order to verify the coin * and to deposit it with the exchange. */ - pc->pending_at_eg--; GNUNET_break_op (0); resume_pay_with_response ( pc, @@ -1452,7 +1447,6 @@ AGE_FAIL: if (0 == group_size) { GNUNET_break (0); - pc->pending_at_eg--; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Group size zero, %u batch transactions remain pending\n", pc->pending_at_eg); @@ -1509,7 +1503,6 @@ AGE_FAIL: /* Signature was invalid or some other constraint was not satisfied. If the exchange was unavailable, we'd get that information in the callback. */ - pc->pending_at_eg--; GNUNET_break_op (0); resume_pay_with_response ( pc, @@ -1520,6 +1513,7 @@ AGE_FAIL: eg->exchange_url))); return; } + pc->pending_at_eg++; if (TMH_force_audit) TALER_EXCHANGE_batch_deposit_force_dc (eg->bdh); } @@ -1542,12 +1536,12 @@ force_keys (struct ExchangeGroup *eg) struct PayContext *pc = eg->pc; GNUNET_break (0); - pc->pending_at_eg--; resume_pay_with_error (pc, TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_LOOKUP_FAILED, "Failed to lookup exchange by URL"); return; } + pc->pending_at_eg++; } |