diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-05-22 16:49:58 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-05-22 16:49:58 +0200 |
commit | 1765554e84fcf0cbf498ae6b997c576dd91a6cec (patch) | |
tree | 166f93a7a8caf90ddb83877797341ee110f93bb8 /src/exchangedb | |
parent | c315462d434e56457ac3dcaed558f6d9775adc06 (diff) | |
download | exchange-1765554e84fcf0cbf498ae6b997c576dd91a6cec.tar.xz |
allow only specifying a wire method
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/exchangedb_accounts.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/exchangedb/exchangedb_accounts.c b/src/exchangedb/exchangedb_accounts.c index e668134e1..439d57674 100644 --- 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; |