-load wire fees only when needed

This commit is contained in:
Christian Grothoff 2022-04-11 15:23:25 +02:00
parent bd09b2302a
commit d30b7f8eeb
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 23 additions and 12 deletions

@ -1 +1 @@
Subproject commit 702e3252edc8a0fc9bf59d35bf66470342061493 Subproject commit 80d310529425013bc47d1b9ab36e9b60f3ed4ed0

View File

@ -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 */ /* Fetch purse details */
qs = TEH_plugin->select_purse_request (TEH_plugin->cls, qs = TEH_plugin->select_purse_request (TEH_plugin->cls,
pcc.purse_pub, pcc.purse_pub,
@ -415,6 +404,28 @@ TEH_handler_purses_merge (
/* we use NULL to represent 'self' as the provider */ /* we use NULL to represent 'self' as the provider */
GNUNET_free (pcc.provider_url); 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 */ /* check signatures */
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_purse_merge_verify ( TALER_wallet_purse_merge_verify (