exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 7993c9b2fd37d64a1846a4fe963dd94e581ac92d
parent efdc91ead4a74afb9b858ea3377bbf5581aabb0d
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 15 Mar 2020 22:28:13 +0100

clean up /wire logic

Diffstat:
Msrc/exchange/taler-exchange-httpd_wire.c | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_wire.c b/src/exchange/taler-exchange-httpd_wire.c @@ -47,11 +47,17 @@ fees_to_json (struct TALER_EXCHANGEDB_AggregateFees *af) json_t *a; a = json_array (); + if (NULL == a) + { + GNUNET_break (0); /* out of memory? */ + return NULL; + } while (NULL != af) { if ( (GNUNET_NO == GNUNET_TIME_round_abs (&af->start_date)) || (GNUNET_NO == GNUNET_TIME_round_abs (&af->end_date)) ) { + GNUNET_break (0); /* bad timestamps, should not happen */ json_decref (a); return NULL; } @@ -72,7 +78,7 @@ fees_to_json (struct TALER_EXCHANGEDB_AggregateFees *af) "sig", GNUNET_JSON_from_data_auto ( &af->master_sig)))) { - GNUNET_break (0); + GNUNET_break (0); /* out of memory? */ json_decref (a); return NULL; } @@ -109,8 +115,9 @@ TEH_WIRE_get_fees (const char *method) if (NULL == af) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed to find current wire transfer fees for `%s'\n", - method); + "Failed to find current wire transfer fees for `%s' at time %s\n", + method, + GNUNET_STRINGS_absolute_time_to_string (now)); return NULL; } j = fees_to_json (af);