[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 01/02: do not generate invalid /wire replies
From: |
gnunet |
Subject: |
[taler-exchange] 01/02: do not generate invalid /wire replies |
Date: |
Sun, 20 Dec 2020 16:49:06 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit a11f6aa8f2fd716c4e6e3cd6b26d1f0623cc5eca
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Dec 20 16:48:34 2020 +0100
do not generate invalid /wire replies
---
src/exchange/taler-exchange-httpd_wire2.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/exchange/taler-exchange-httpd_wire2.c
b/src/exchange/taler-exchange-httpd_wire2.c
index b4f60b72..876cece1 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,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.