summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-28 23:40:12 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-28 23:40:12 +0100
commit417af3ad417198a5087306d5f0f959473ed8399e (patch)
tree6637d0e67c9ccf62e792f0dba8b2b6fa3696d11a /src/backend
parenta08b70f6244fafa2664f694cf28c0e3d128a9a0b (diff)
downloadmerchant-417af3ad417198a5087306d5f0f959473ed8399e.tar.gz
merchant-417af3ad417198a5087306d5f0f959473ed8399e.tar.bz2
merchant-417af3ad417198a5087306d5f0f959473ed8399e.zip
fix re-use of prepared statement, and escaping
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-depositcheck.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-depositcheck.c b/src/backend/taler-merchant-depositcheck.c
index ecb6b24e..cc0aaae5 100644
--- a/src/backend/taler-merchant-depositcheck.c
+++ b/src/backend/taler-merchant-depositcheck.c
@@ -31,6 +31,11 @@
*/
#define CONCURRENCY_LIMIT 32
+/**
+ * How long do we not try a deposit check if the deposit
+ * was put on hold due to a KYC/AML block?
+ */
+#define KYC_RETRY_DELAY GNUNET_TIME_UNIT_HOURS
/**
* Information we keep per exchange.
@@ -484,8 +489,7 @@ deposit_get_cb (void *cls,
qs = db_plugin->update_deposit_confirmation_status (
db_plugin->cls,
w->deposit_serial,
- false, /* we are blocked on KYC, wire_pending is now false */
- /* FIXME: once the KYC is done, is there logic to get this back to TRUE? */
+ true, /* wire_pending is still true! */
GNUNET_TIME_absolute_to_timestamp (future_retry),
w->retry_backoff,
"Exchange reported 202 Accepted but no KYC block");
@@ -496,6 +500,30 @@ deposit_get_cb (void *cls,
return;
}
}
+ else
+ {
+ future_retry
+ = GNUNET_TIME_absolute_max (
+ future_retry,
+ GNUNET_TIME_relative_to_absolute (
+ KYC_RETRY_DELAY));
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Bumping wire transfer deadline in DB to %s as that is when we will retry\n",
+ GNUNET_TIME_absolute2s (future_retry));
+ qs = db_plugin->update_deposit_confirmation_status (
+ db_plugin->cls,
+ w->deposit_serial,
+ true, /* FIXME: should we set this to 'false' as we are awaiting KYC? */
+ GNUNET_TIME_absolute_to_timestamp (future_retry),
+ w->retry_backoff,
+ "Exchange reported 202 Accepted due to KYC/AML block");
+ if (qs < 0)
+ {
+ GNUNET_break (0);
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+ }
break;
}
default: