diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-03-03 23:52:08 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-03-03 23:52:08 +0100 |
commit | 1643b745af309f754959621fa2a631c899ba1975 (patch) | |
tree | 19d6252ad82a78e432b8c969b948a7e0cb36c33b /src/lib | |
parent | f951cdef8ced141326887c1a996e8546774514f6 (diff) |
use 32 byte hash for hpayto, use that for joins on queries to better align queries with partitions
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/exchange_api_kyc_proof.c | 22 | ||||
-rw-r--r-- | src/lib/exchange_api_reserves_get.c | 2 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/exchange_api_kyc_proof.c b/src/lib/exchange_api_kyc_proof.c index f2ca24eb1..d3debbdb9 100644 --- a/src/lib/exchange_api_kyc_proof.c +++ b/src/lib/exchange_api_kyc_proof.c @@ -141,7 +141,7 @@ handle_kyc_proof_finished (void *cls, struct TALER_EXCHANGE_KycProofHandle * TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *exchange, - uint64_t payment_target, + const struct TALER_PaytoHashP *h_payto, const char *code, const char *state, TALER_EXCHANGE_KycProofCallback cb, @@ -158,11 +158,21 @@ TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *exchange, return NULL; } /* TODO: any escaping of code/state needed??? */ - GNUNET_asprintf (&arg_str, - "/kyc-proof/%llu?code=%s&state=%s", - (unsigned long long) payment_target, - code, - state); + { + char hstr[sizeof (struct TALER_PaytoHashP) * 2]; + char *end; + + end = GNUNET_STRINGS_data_to_string (h_payto, + sizeof (*h_payto), + hstr, + sizeof (hstr)); + *end = '\0'; + GNUNET_asprintf (&arg_str, + "/kyc-proof/%s?code=%s&state=%s", + hstr, + code, + state); + } kph = GNUNET_new (struct TALER_EXCHANGE_KycProofHandle); kph->exchange = exchange; kph->cb = cb; diff --git a/src/lib/exchange_api_reserves_get.c b/src/lib/exchange_api_reserves_get.c index 7f919ef80..3bdfbd287 100644 --- a/src/lib/exchange_api_reserves_get.c +++ b/src/lib/exchange_api_reserves_get.c @@ -260,7 +260,7 @@ TALER_EXCHANGE_reserves_get ( end = GNUNET_STRINGS_data_to_string ( reserve_pub, - sizeof (struct TALER_ReservePublicKeyP), + sizeof (*reserve_pub), pub_str, sizeof (pub_str)); *end = '\0'; |