diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-20 16:09:18 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-20 16:09:18 +0100 |
commit | b8f25a07e94cc9f421a547e8d6c9c8026d39f710 (patch) | |
tree | 0b0cb8bfe4e2a16b47750a5479fbf4b891aaf303 /src/backend/taler-merchant-httpd_history.c | |
parent | 2e761cdd0b811f4a283c424ccdf5de4dcabd9eb3 (diff) | |
download | merchant-b8f25a07e94cc9f421a547e8d6c9c8026d39f710.tar.gz merchant-b8f25a07e94cc9f421a547e8d6c9c8026d39f710.tar.bz2 merchant-b8f25a07e94cc9f421a547e8d6c9c8026d39f710.zip |
Fix lib testcase.
Diffstat (limited to 'src/backend/taler-merchant-httpd_history.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_history.c | 43 |
1 files changed, 11 insertions, 32 deletions
diff --git a/src/backend/taler-merchant-httpd_history.c b/src/backend/taler-merchant-httpd_history.c index 44e8216c..e7bd12dc 100644 --- a/src/backend/taler-merchant-httpd_history.c +++ b/src/backend/taler-merchant-httpd_history.c @@ -36,12 +36,6 @@ static int start = -1; static unsigned int delta; /** - * Index to the current row being processed. - */ -static unsigned int current = 0; - - -/** * Function called with information about a transaction. * * @param cls closure @@ -60,33 +54,23 @@ pd_cb (void *cls, json_t *amount; json_t *timestamp; json_t *instance; + uint64_t r64 = (uint64_t) row_id; GNUNET_assert (-1 != json_unpack ((json_t *) proposal_data, - "{s:o, s:o, s:{s:o}, s:I}", + "{s:o, s:o, s:{s:o}}", "amount", &amount, "timestamp", ×tamp, - "merchant", "instance", &instance, - "row_id", (json_int_t) row_id)); + "merchant", "instance", &instance)); - if ( (current >= start) && - (current < start + delta) ) - { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Adding history element. Current: %u, start: %u, delta: %u\n", - current, - start, - delta); - GNUNET_break (NULL != (entry = json_pack ("{s:s, s:O, s:O, s:O}", - "order_id", order_id, - "amount", amount, - "timestamp", timestamp, - "instance", instance))); - - GNUNET_break (0 == json_array_append_new (response, - entry)); - } + GNUNET_break (NULL != (entry = json_pack ("{s:I, s:s, s:O, s:O, s:O}", + "row_id", r64, + "order_id", order_id, + "amount", amount, + "timestamp", timestamp, + "instance", instance))); - current++; + GNUNET_break (0 == json_array_append_new (response, + entry)); } @@ -206,11 +190,6 @@ MH_handler_history (struct TMH_RequestHandler *rh, delta, pd_cb, response); - - - - - current = 0; if (GNUNET_SYSERR == ret) { json_decref (response); |