exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit d30b7f8eeb7ff483e2b7d4e6287d9abf86090b8d
parent bd09b2302a0b2e7a21c8e19104d84ce3d75600fc
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Mon, 11 Apr 2022 15:23:25 +0200

-load wire fees only when needed

Diffstat:
Msrc/exchange/taler-exchange-httpd_purses_merge.c | 33++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_purses_merge.c b/src/exchange/taler-exchange-httpd_purses_merge.c @@ -304,17 +304,6 @@ TEH_handler_purses_merge ( } } - pcc.wf = TEH_wire_fees_by_time (pcc.exchange_timestamp, - "sepa"); // FIXME! - if (NULL == pcc.wf) - { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Cannot create purse: global fees not configured!\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_EXCHANGE_GENERIC_GLOBAL_FEES_MISSING, - NULL); - } /* Fetch purse details */ qs = TEH_plugin->select_purse_request (TEH_plugin->cls, pcc.purse_pub, @@ -415,6 +404,28 @@ TEH_handler_purses_merge ( /* we use NULL to represent 'self' as the provider */ GNUNET_free (pcc.provider_url); } + else + { + char *method = GNUNET_strdup ("FIXME"); + + /* FIXME: lookup wire method by pcc.provider_url! */ + pcc.wf = TEH_wire_fees_by_time (pcc.exchange_timestamp, + method); + if (NULL == pcc.wf) + { + MHD_RESULT res; + + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Cannot merge purse: wire fees not configured!\n"); + res = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_EXCHANGE_GENERIC_WIRE_FEES_MISSING, + method); + GNUNET_free (method); + return res; + } + GNUNET_free (method); + } /* check signatures */ if (GNUNET_OK != TALER_wallet_purse_merge_verify (