commit 259ce6b331ee60108392a526a3a6106a188b7762
parent 9993630e2b57a170d6188b315e7c5445ba1ae01a
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 4 May 2025 15:08:13 +0200
fix bad cleanup in case wire-auditor is receiving notification while long-polling/transacting
Diffstat:
2 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c
@@ -714,6 +714,7 @@ process_credits (void *cls);
static void
conclude_account (struct WireAccount *wa)
{
+ GNUNET_assert (NULL == wa->chh);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Reconciling CREDIT processing of account `%s'\n",
wa->ai->section_name);
@@ -1089,6 +1090,7 @@ process_credits (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"pass `%s'\n",
wa->ai->auth->details.basic.password);
+ GNUNET_assert (NULL == wa->chh);
wa->chh = TALER_BANK_credit_history (ctx,
wa->ai->auth,
wa->wire_off_in,
@@ -1260,6 +1262,20 @@ 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 != wa->chh)
+ {
+ TALER_BANK_credit_history_cancel (wa->chh);
+ wa->chh = NULL;
+ }
+ conclude_account (wa);
+ }
+
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
begin_transaction ())
{
diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c
@@ -1782,6 +1782,20 @@ 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 != wa->dhh)
+ {
+ TALER_BANK_debit_history_cancel (wa->dhh);
+ wa->dhh = NULL;
+ }
+ check_exchange_wire_out (wa);
+ }
+
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
begin_transaction ())
{