summaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-12-19 14:13:55 +0100
committerChristian Grothoff <christian@grothoff.org>2022-12-19 14:13:55 +0100
commit80660f2d882391118d7ad41f73d495d3f84e2244 (patch)
tree0148fc70d64fb80be31cb006bd19ebda84ed484f /src/bank-lib
parentd3a9160e0fad8d75dc61ecde6b7a22ff9c054446 (diff)
downloadexchange-80660f2d882391118d7ad41f73d495d3f84e2244.tar.gz
exchange-80660f2d882391118d7ad41f73d495d3f84e2244.tar.bz2
exchange-80660f2d882391118d7ad41f73d495d3f84e2244.zip
return 204 on empty transaction history, as per API
Diffstat (limited to 'src/bank-lib')
-rw-r--r--src/bank-lib/fakebank.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index b3d3250a1..810290417 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -2312,14 +2312,21 @@ handle_debit_history (struct TALER_FAKEBANK_Handle *h,
pos = t;
}
}
+ if (0 == ha.delta)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "No debit transactions exist after given starting point\n");
+ return TALER_MHD_reply_static (connection,
+ MHD_HTTP_NO_CONTENT,
+ NULL,
+ NULL,
+ 0);
+ }
if (NULL != pos)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Returning %lld debit transactions starting (inclusive) from %llu\n",
(long long) ha.delta,
(unsigned long long) pos->row_id);
- else
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "No debit transactions exist after given starting point\n");
while ( (0 != ha.delta) &&
(NULL != pos) )
{
@@ -2525,14 +2532,21 @@ handle_credit_history (struct TALER_FAKEBANK_Handle *h,
pos = t;
}
}
+ if (0 == ha.delta)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "No credit transactions exist after given starting point\n");
+ return TALER_MHD_reply_static (connection,
+ MHD_HTTP_NO_CONTENT,
+ NULL,
+ NULL,
+ 0);
+ }
if (NULL != pos)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Returning %lld credit transactions starting (inclusive) from %llu\n",
(long long) ha.delta,
(unsigned long long) pos->row_id);
- else
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "No credit transactions exist after given starting point\n");
while ( (0 != ha.delta) &&
(NULL != pos) )
{