exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 77f5a41ff26371cfc77644ba49c760e7778c142b
parent 264c4a8eb49248723d9dd6cfa7b1be4eaa95c5e3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 10 Oct 2026 22:03:39 +0200

stop bank history checks if we reached the num_results limit

Diffstat:
Msrc/testing/testing_api_cmd_bank_history_credit.c | 11+++++++++--
Msrc/testing/testing_api_cmd_bank_history_debit.c | 11+++++++++--
2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/testing/testing_api_cmd_bank_history_credit.c b/src/testing/testing_api_cmd_bank_history_credit.c @@ -285,8 +285,8 @@ command_cb (void *cls, if (0 != strcasecmp (hs->account_url, exchange_credit_url)) return; // Account mismatch - if (ic->total >= GNUNET_MAX (hs->num_results, - -hs->num_results) ) + if (ic->pos >= GNUNET_MAX (hs->num_results, + -hs->num_results) ) { TALER_LOG_DEBUG ("Hit history limit\n"); return; @@ -549,6 +549,13 @@ history_cb (void *cls, } hs->results_obtained++; } + if (hs->results_obtained != (uint64_t) hs->total) + { + /* bank returned fewer results than we expected */ + GNUNET_break (0); + hs->failed = true; + goto error; + } TALER_TESTING_interpreter_next (is); return; case MHD_HTTP_NO_CONTENT: diff --git a/src/testing/testing_api_cmd_bank_history_debit.c b/src/testing/testing_api_cmd_bank_history_debit.c @@ -242,8 +242,8 @@ command_cb (void *cls, /* when 'start' was _not_ given, then ok == GNUNET_YES */ if (! ic->ok) return; /* skip until we find the marker */ - if (ic->total >= GNUNET_MAX (hs->num_results, - -hs->num_results) ) + if (ic->pos >= GNUNET_MAX (hs->num_results, + -hs->num_results) ) { TALER_LOG_DEBUG ("Hit history limit\n"); return; @@ -431,6 +431,13 @@ history_cb (void *cls, } hs->results_obtained++; } + if (hs->results_obtained != (uint64_t) hs->total) + { + /* bank returned fewer results than we expected */ + GNUNET_break (0); + hs->failed = true; + goto error; + } TALER_TESTING_interpreter_next (is); return; case MHD_HTTP_NO_CONTENT: