summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-20 16:48:34 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-20 16:48:34 +0100
commita11f6aa8f2fd716c4e6e3cd6b26d1f0623cc5eca (patch)
tree3d036ac9b1e4565e56692977cd2331947118734b /src
parent6f69bc424ab330c03904e5317973a2e6748db8e0 (diff)
downloadexchange-a11f6aa8f2fd716c4e6e3cd6b26d1f0623cc5eca.tar.gz
exchange-a11f6aa8f2fd716c4e6e3cd6b26d1f0623cc5eca.tar.bz2
exchange-a11f6aa8f2fd716c4e6e3cd6b26d1f0623cc5eca.zip
do not generate invalid /wire replies
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd_wire2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_wire2.c b/src/exchange/taler-exchange-httpd_wire2.c
index b4f60b725..876cece1d 100644
--- a/src/exchange/taler-exchange-httpd_wire2.c
+++ b/src/exchange/taler-exchange-httpd_wire2.c
@@ -213,6 +213,13 @@ build_wire_state (void)
json_decref (wire_accounts_array);
return NULL;
}
+ if (0 == json_array_size (wire_accounts_array))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "No bank accounts for the exchange configured. Administrator must `enable-account` with taler-exchange-offline!\n");
+ json_decref (wire_accounts_array);
+ return NULL;
+ }
wire_fee_object = json_object ();
GNUNET_assert (NULL != wire_fee_object);
{
@@ -243,6 +250,15 @@ build_wire_state (void)
json_decref (wire_accounts_array);
return NULL;
}
+ if (0 == json_array_size (a))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "No wire fees for `%s' configured. Administrator must set `wire-fee` with taler-exchange-offline!\n",
+ wire_method);
+ json_decref (wire_accounts_array);
+ json_decref (wire_fee_object);
+ return NULL;
+ }
GNUNET_assert (0 ==
json_object_set_new (wire_fee_object,
wire_method,