diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-08-11 23:35:57 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-08-11 23:35:57 +0200 |
commit | 1b751d3f8c6bb7efd9b4acd54b4a1bf5266043bf (patch) | |
tree | 8855c2d979f8f273254d8e593cf364c19c73a9f3 /src/backend/taler-merchant-httpd_post-orders-ID-pay.c | |
parent | 7aec7a252f2ac6ae677b9fa48c831963ab719582 (diff) | |
download | merchant-1b751d3f8c6bb7efd9b4acd54b4a1bf5266043bf.tar.gz merchant-1b751d3f8c6bb7efd9b4acd54b4a1bf5266043bf.tar.bz2 merchant-1b751d3f8c6bb7efd9b4acd54b4a1bf5266043bf.zip |
-fix handling of serialization failure
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 | 6 |
1 files changed, 4 insertions, 2 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 91533de5..72c3e4da 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -942,7 +942,6 @@ handle_batch_deposit_ok (struct ExchangeGroup *eg, const struct TALER_EXCHANGE_BatchDepositResult *dr) { struct PayContext *pc = eg->pc; - unsigned int j = 0; enum GNUNET_DB_QueryStatus qs = GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; @@ -954,6 +953,8 @@ handle_batch_deposit_ok (struct ExchangeGroup *eg, pc->hc->instance->settings.id); for (unsigned int r = 0; r<MAX_RETRIES; r++) { + unsigned int j = 0; + TMH_db->preflight (TMH_db->cls); if (GNUNET_OK != TMH_db->start (TMH_db->cls, @@ -982,6 +983,7 @@ handle_batch_deposit_ok (struct ExchangeGroup *eg, it is possible to over-pay if two wallets literally make a concurrent payment, as the earlier check for 'paid' is not in the same transaction scope as this 'insert' operation. */ + GNUNET_assert (j < dr->details.success.num_signatures); qs = TMH_db->insert_deposit ( TMH_db->cls, pc->hc->instance->settings.id, @@ -999,7 +1001,7 @@ handle_batch_deposit_ok (struct ExchangeGroup *eg, if (GNUNET_DB_STATUS_SOFT_ERROR == qs) { TMH_db->rollback (TMH_db->cls); - continue; + break; } if (0 > qs) { |