diff options
Diffstat (limited to 'src/bank-lib/fakebank_twg_history.c')
-rw-r--r-- | src/bank-lib/fakebank_twg_history.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/bank-lib/fakebank_twg_history.c b/src/bank-lib/fakebank_twg_history.c index c10358c1a..6d3c376e5 100644 --- a/src/bank-lib/fakebank_twg_history.c +++ b/src/bank-lib/fakebank_twg_history.c @@ -325,7 +325,12 @@ TALER_FAKEBANK_twg_get_credit_history_ ( *con_cls = cc; hc = GNUNET_new (struct HistoryContext); cc->ctx = hc; - + hc->history = json_array (); + if (NULL == hc->history) + { + GNUNET_break (0); + return MHD_NO; + } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handling /history/incoming connection %p\n", connection); @@ -337,6 +342,7 @@ TALER_FAKEBANK_twg_get_credit_history_ ( GNUNET_break_op (0); return (GNUNET_SYSERR == ret) ? MHD_NO : MHD_YES; } + hc->timeout = GNUNET_TIME_relative_to_absolute (hc->ha.lp_timeout); GNUNET_assert (0 == pthread_mutex_lock (&h->big_lock)); if (UINT64_MAX == hc->ha.start_idx) @@ -353,15 +359,6 @@ TALER_FAKEBANK_twg_get_credit_history_ ( TALER_EC_BANK_UNKNOWN_ACCOUNT, account); } - hc->history = json_array (); - if (NULL == hc->history) - { - GNUNET_break (0); - GNUNET_assert (0 == - pthread_mutex_unlock (&h->big_lock)); - return MHD_NO; - } - hc->timeout = GNUNET_TIME_relative_to_absolute (hc->ha.lp_timeout); } else { |