commit ccd931aee6022853d34f8c8f933183c4ec6472cf
parent c9650e7ec7542292b233794e14c411405cdd4595
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 3 Mar 2017 20:40:39 +0100
fix reference counting bug
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_history.c b/src/backend/taler-merchant-httpd_history.c
@@ -53,7 +53,6 @@ unsigned int current = 0;
* @param refund refund deadline
* @param total_amount total amount we receive for the contract after fees
*/
-
static void
pd_cb (void *cls,
const char *order_id,
@@ -71,27 +70,29 @@ pd_cb (void *cls,
"timestamp", ×tamp,
"merchant", "instance", &instance));
- if (current >= start && current < start + delta)
+ if ( (current >= start) &&
+ (current < start + delta) )
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Adding history element. Current: %d, start: %d, delta: %d\n",
current,
start,
delta);
- GNUNET_break (NULL != (entry = json_pack ("{s:s, s:o, s:s, s:s}",
+ GNUNET_break (NULL != (entry = json_pack ("{s:s, s:O, s:s, s:s}",
"order_id", order_id,
"amount", amount,
"timestamp", json_string_value (timestamp),
"instance", json_string_value (instance))));
- GNUNET_break (0 == json_array_append_new (response, entry));
-
+ GNUNET_break (0 == json_array_append_new (response,
+ entry));
}
// FIXME to zero after returned.
current++;
}
+
/**
* Manage a /history request. Query the db and returns transactions
* younger than the date given as parameter