summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_kyc-check.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-03 23:52:08 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-03 23:52:08 +0100
commit1643b745af309f754959621fa2a631c899ba1975 (patch)
tree19d6252ad82a78e432b8c969b948a7e0cb36c33b /src/exchange/taler-exchange-httpd_kyc-check.c
parentf951cdef8ced141326887c1a996e8546774514f6 (diff)
downloadexchange-1643b745af309f754959621fa2a631c899ba1975.tar.gz
exchange-1643b745af309f754959621fa2a631c899ba1975.tar.bz2
exchange-1643b745af309f754959621fa2a631c899ba1975.zip
use 32 byte hash for hpayto, use that for joins on queries to better align queries with partitions
Diffstat (limited to 'src/exchange/taler-exchange-httpd_kyc-check.c')
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-check.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c
index 1e7f4da12..ba9186866 100644
--- a/src/exchange/taler-exchange-httpd_kyc-check.c
+++ b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -60,11 +60,16 @@ struct KycPoller
struct GNUNET_DB_EventHandler *eh;
/**
- * UUID being checked.
+ * UUID found based on @e h_payto.
*/
uint64_t payment_target_uuid;
/**
+ * UUID being checked.
+ */
+ uint64_t auth_payment_target_uuid;
+
+ /**
* Current KYC status.
*/
struct TALER_EXCHANGEDB_KycStatus kyc;
@@ -76,11 +81,6 @@ struct KycPoller
struct TALER_PaytoHashP h_payto;
/**
- * Hash of the payto:// URI that was given to us for auth.
- */
- struct TALER_PaytoHashP auth_h_payto;
-
- /**
* When will this request time out?
*/
struct GNUNET_TIME_Absolute timeout;
@@ -170,7 +170,6 @@ kyc_check (void *cls,
enum GNUNET_DB_QueryStatus qs;
qs = TEH_plugin->select_kyc_status (TEH_plugin->cls,
- kyp->payment_target_uuid,
&kyp->h_payto,
&kyp->kyc);
if (qs < 0)
@@ -184,6 +183,9 @@ kyc_check (void *cls,
"inselect_wallet_status");
return qs;
}
+ // FIXME: avoid duplicating this...
+ kyp->payment_target_uuid = kyp->kyc.payment_target_uuid;
+
return qs;
}
@@ -261,7 +263,7 @@ TEH_handler_kyc_check (
TALER_EC_GENERIC_PARAMETER_MALFORMED,
"payment_target_uuid");
}
- kyp->payment_target_uuid = (uint64_t) payment_target_uuid;
+ kyp->auth_payment_target_uuid = (uint64_t) payment_target_uuid;
}
{
const char *ts;
@@ -308,8 +310,8 @@ TEH_handler_kyc_check (
if (GNUNET_OK !=
GNUNET_STRINGS_string_to_data (hps,
strlen (hps),
- &kyp->auth_h_payto,
- sizeof (kyp->auth_h_payto)))
+ &kyp->h_payto,
+ sizeof (kyp->h_payto)))
{
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
@@ -334,7 +336,7 @@ TEH_handler_kyc_check (
struct TALER_KycCompletedEventP rep = {
.header.size = htons (sizeof (rep)),
.header.type = htons (TALER_DBEVENT_EXCHANGE_KYC_COMPLETED),
- .h_payto = kyp->auth_h_payto
+ .h_payto = kyp->h_payto
};
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -356,9 +358,9 @@ TEH_handler_kyc_check (
kyp);
if (GNUNET_SYSERR == ret)
return res;
- if (0 !=
- GNUNET_memcmp (&kyp->h_payto,
- &kyp->auth_h_payto))
+
+ if (kyp->auth_payment_target_uuid !=
+ kyp->payment_target_uuid)
{
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,