merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit e1d591f9f8a10d0b60e9ae2760321fe556b30b42
parent 19f6e64faa2fd2c25f6cb45ebe3c17feebd42885
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  8 May 2025 21:53:16 +0200

fix #9894

Diffstat:
Msrc/backend/taler-merchant-httpd_post-orders-ID-pay.c | 17+++++++++++------
1 file changed, 11 insertions(+), 6 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 @@ -54,9 +54,13 @@ #define MAX_RETRIES 5 /** - * Maximum number of coins that we allow per transaction + * Maximum number of coins that we allow per transaction. + * Note that the limit for each batch deposit request to + * the exchange is lower, so we may break a very large + * number of coins up into multiple smaller requests to + * the exchange. */ -#define MAX_COIN_ALLOWED_COINS 64 +#define MAX_COIN_ALLOWED_COINS 1024 /** * Maximum number of tokens that we allow as inputs per transaction @@ -1435,7 +1439,8 @@ AGE_FAIL: } return; } - + if (group_size > TALER_MAX_COINS) + group_size = TALER_MAX_COINS; { struct TALER_EXCHANGE_CoinDepositDetail cdds[group_size]; struct TALER_EXCHANGE_DepositContractDetail dcd = { @@ -1463,8 +1468,9 @@ AGE_FAIL: if (0 != strcmp (dc->exchange_url, eg->exchange_url)) continue; - GNUNET_assert (off < group_size); cdds[off++] = dc->cdd; + if (off >= group_size) + break; } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Initiating batch deposit with %u coins\n", @@ -2016,8 +2022,7 @@ check_payment_sufficient (struct PayContext *pc) "Total refunded amount: %s\n", TALER_amount2s (&pc->pay_transaction.total_refunded)); - /* Now compare exchange wire fee compared to - * what we are willing to pay */ + /* Now compare exchange wire fee compared to what we are willing to pay */ if (GNUNET_YES != TALER_amount_cmp_currency (&total_wire_fee, &acc_fee))