summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-depositcheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-depositcheck.c')
-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: