commit 1765554e84fcf0cbf498ae6b997c576dd91a6cec
parent c315462d434e56457ac3dcaed558f6d9775adc06
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 22 May 2024 16:49:58 +0200
allow only specifying a wire method
Diffstat:
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/src/exchangedb/exchangedb_accounts.c b/src/exchangedb/exchangedb_accounts.c
@@ -190,27 +190,36 @@ add_account_cb (void *cls,
( (credit) &&
(lc->credit) ) ) )
return; /* not enabled for us, skip */
- if (GNUNET_OK !=
+ if (GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_string (cfg,
section,
"PAYTO_URI",
&payto_uri))
{
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
- section,
- "PAYTO_URI");
- return;
+ method = TALER_payto_get_method (payto_uri);
+ GNUNET_free (payto_uri);
+ if (NULL == method)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "payto URI in config ([%s]/PAYTO_URI) malformed\n",
+ section);
+ lc->res = GNUNET_SYSERR;
+ return;
+ }
}
- method = TALER_payto_get_method (payto_uri);
- GNUNET_free (payto_uri);
- if (NULL == method)
+ else if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ section,
+ "WIRE_METHOD",
+ &method))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "payto URI in config ([%s]/PAYTO_URI) malformed\n",
- section);
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
+ section,
+ "WIRE_METHOD");
lc->res = GNUNET_SYSERR;
return;
}
+ GNUNET_assert (NULL != method);
wa = GNUNET_new (struct WireAccount);
wa->section_name = GNUNET_strdup (section);
wa->method = method;