diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-04-13 17:55:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-04-13 17:55:31 +0200 |
commit | ee478c6c8097ac385dbfeeb80d186a1f108b304c (patch) | |
tree | 4d3b0f186b8f55029e87c049bacb57b7cf567ddd /src/backend/taler-merchant-wirewatch.c | |
parent | 3e8115c5e4a2c9a7f37202c63f107230d8087c42 (diff) |
actually implement -t option for taler-merchant-wirewatch
Diffstat (limited to 'src/backend/taler-merchant-wirewatch.c')
-rw-r--r-- | src/backend/taler-merchant-wirewatch.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-wirewatch.c b/src/backend/taler-merchant-wirewatch.c index 2c62b446..7ffc4e10 100644 --- 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) |