merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit ee478c6c8097ac385dbfeeb80d186a1f108b304c
parent 3e8115c5e4a2c9a7f37202c63f107230d8087c42
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu, 13 Apr 2023 17:55:31 +0200

actually implement -t option for taler-merchant-wirewatch

Diffstat:
Msrc/backend/taler-merchant-wirewatch.c | 18+++++++++++++++++-
Msrc/testing/test_merchant_api.c | 3++-
2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/backend/taler-merchant-wirewatch.c b/src/backend/taler-merchant-wirewatch.c @@ -110,6 +110,11 @@ static uint64_t start_row; */ static bool progress_update; +/** + * Set to true if we found a transaction in the last iteration. + */ +static bool found; + /** * Save progress in DB. @@ -261,6 +266,7 @@ credit_cb ( char *exchange_url; struct TALER_WireTransferIdentifierRawP wtid; + found = true; if (GNUNET_OK != parse_subject (details->wire_subject, &wtid, @@ -303,6 +309,13 @@ credit_cb ( break; } hh = NULL; + if (test_mode && (! found)) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "No transactions found and in test mode. Shutting down!\n"); + GNUNET_SCHEDULER_shutdown (); + return GNUNET_OK; + } task = GNUNET_SCHEDULER_add_delayed (delay, &do_work, NULL); @@ -315,11 +328,14 @@ do_work (void *cls) { (void) cls; task = NULL; + found = false; hh = TALER_MERCHANT_BANK_credit_history (ctx, &ad, start_row, batch_size, - BANK_TIMEOUT, + test_mode + ? GNUNET_TIME_UNIT_ZERO + : BANK_TIMEOUT, &credit_cb, NULL); if (NULL == hh) diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c @@ -2052,7 +2052,8 @@ main (int argc, NULL, config_file); - GNUNET_OS_process_kill (merchantd, SIGTERM); + GNUNET_OS_process_kill (merchantd, + SIGTERM); GNUNET_OS_process_wait (merchantd); GNUNET_OS_process_destroy (merchantd); GNUNET_free (merchant_url);