aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-03-21 18:45:50 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-03-21 18:45:50 +0100
commita3979b583fab4358c01a885a3b4468f8776b4027 (patch)
tree09e888c4c5784941ad537278c24e3f7919089bac
parent341e08b3dd0385d0af069c9137b5bdf598d0bcc7 (diff)
"/history" 'start' default value.
The fakebank got adapted to the same logic from the Python bank (with negative deltas, 'start' defaults to UINT64_MAX, whereas with positives it defaults to 0).
-rw-r--r--src/bank-lib/fakebank.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 19f4816e0..09ec1bbe6 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -527,11 +527,11 @@ handle_admin_add_incoming (struct TALER_FAKEBANK_Handle *h,
return MHD_NO;
}
row_id = TALER_FAKEBANK_make_transfer (h,
- debit_account,
- credit_account,
- &amount,
- subject,
- base_url);
+ debit_account,
+ credit_account,
+ &amount,
+ subject,
+ base_url);
amount_s = TALER_amount_to_string (&amount);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Receiving incoming wire transfer: %llu->%llu, subject: %s, amount: %s, from %s\n",
@@ -804,8 +804,10 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
GNUNET_assert (0);
return MHD_NO;
}
+
if (NULL == start)
- pos = h->transactions_tail;
+ pos = 0 > count ? h->transactions_tail : h->transactions_head;
+
else if (NULL != h->transactions_head)
{
for (pos = h->transactions_head;