commit 979e51fde63c22e060976465c0345df9acc3ea6d
parent 8bf2899f73680873fa726508f1ee80f48c5f7f4e
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 8 Nov 2026 23:23:26 +0100
defer restarting until current tx is finished
Diffstat:
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c
@@ -262,6 +262,12 @@ static int ignore_account_404;
static struct GNUNET_DB_EventHandler *eh;
/**
+ * Set if we were woken up while an audit was still running, so that
+ * we start another one as soon as the current one has been committed.
+ */
+static bool rerun;
+
+/**
* The auditors's configuration.
*/
static const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -555,7 +561,22 @@ commit (enum GNUNET_DB_QueryStatus qs)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Transaction concluded!\n");
if (1 == test_mode)
+ {
GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ if (rerun)
+ {
+ /* we were woken up while this audit was running */
+ rerun = false;
+ if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
+ begin_transaction ())
+ {
+ GNUNET_break (0);
+ global_ret = EXIT_FAILURE;
+ GNUNET_SCHEDULER_shutdown ();
+ }
+ }
return;
handle_db_error:
rollback_and_reset ();
@@ -1941,20 +1962,14 @@ db_notify (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Received notification to wake wire helper\n");
- /* If there are accounts we are still processing, abort
- the HTTP requests so we can start afresh. */
- for (struct WireAccount *wa = wa_head;
- NULL != wa;
- wa = wa->next)
+ if (NULL != in_map)
{
- if (NULL != wa->chh)
- {
- TALER_BANK_credit_history_cancel (wa->chh);
- wa->chh = NULL;
- }
- conclude_account (wa);
+ /* An audit is still running. Concluding its accounts now would
+ report every transfer whose bank record we have not yet fetched
+ as missing, so let it finish and start another one afterwards. */
+ rerun = true;
+ return;
}
-
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
begin_transaction ())
{