This commit is contained in:
Christian Grothoff 2017-03-08 11:59:01 +01:00
parent 7ba2ee0966
commit 5f5babca93
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 42 additions and 12 deletions

View File

@ -624,10 +624,6 @@ exchange_serve_process_config ()
(unsigned int) TALER_CURRENCY_LEN);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
TEH_VALIDATION_init (cfg))
return GNUNET_SYSERR;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
"exchange",
@ -637,7 +633,6 @@ exchange_serve_process_config ()
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"exchange",
"master_public_key");
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@ -648,11 +643,17 @@ exchange_serve_process_config ()
fprintf (stderr,
"Invalid master public key given in exchange configuration.");
GNUNET_free (TEH_master_public_key_str);
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
GNUNET_free (TEH_master_public_key_str);
if ( (GNUNET_OK !=
TEH_VALIDATION_init (cfg)) ||
(GNUNET_OK !=
TEH_WIRE_init ()) )
return GNUNET_SYSERR;
if (NULL ==
(TEH_plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
{

View File

@ -120,15 +120,34 @@ TEH_WIRE_handler_wire (struct TEH_RequestHandler *rh,
const char *upload_data,
size_t *upload_data_size)
{
if (NULL == wire_methods)
wire_methods = TEH_VALIDATION_get_wire_methods ("exchange-wire-incoming");
GNUNET_assert (NULL != wire_methods);
return TEH_RESPONSE_reply_json (connection,
wire_methods,
MHD_HTTP_OK);
}
/**
* Initialize wire subsystem.
*
* @return #GNUNET_OK on success, #GNUNET_SYSERR if we found no valid
* wire methods
*/
int
TEH_WIRE_init ()
{
wire_methods = TEH_VALIDATION_get_wire_methods ("exchange-wire-incoming");
if ( (NULL == wire_methods) ||
(0 == json_object_size (wire_methods)) )
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to find properly configured wire transfer method\n");
return GNUNET_SYSERR;
}
return GNUNET_OK;
}
/**
* Initialize libgcrypt.
*/

View File

@ -26,6 +26,16 @@
#include "taler-exchange-httpd.h"
/**
* Initialize wire subsystem.
*
* @return #GNUNET_OK on success, #GNUNET_SYSERR if we found no valid
* wire methods
*/
int
TEH_WIRE_init (void);
/**
* Obtain fee structure for @a wire_plugin_name wire transfers.
*