commit 61139f478348640dc5e11d2ad4f55f473216256e parent 7ecc2c5cf10f27caad5c2f1aefa8a135cc884667 Author: Florian Dold <florian@dold.me> Date: Tue, 3 Jun 2025 15:52:44 +0200 fix sql query for kyc auth Issue: https://bugs.taler.net/n/10064 Diffstat:
| M | src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql | | | 10 | ++++------ |
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql b/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql @@ -106,18 +106,16 @@ END IF; -- Check most recent reserve_in wire transfer, we also -- allow that reserve public key for authentication! +-- Only needed for old wallets that don't pass +-- in the account pub explicitly. SELECT reserve_pub INTO out_reserve_pub FROM reserves_in WHERE wire_source_h_payto - IN (SELECT wire_source_h_payto - FROM wire_targets + IN (SELECT wt.wire_target_h_payto + FROM wire_targets wt WHERE h_normalized_payto=in_h_normalized_payto) ORDER BY execution_date DESC, reserve_in_serial_id DESC LIMIT 1; --- FIXME: may want to turn this around and pass *in* the --- reserve_pub as an argument and then not LIMIT 1 but check --- if any reserve_pub ever matched (and just return a BOOL --- to indicate if the kyc-auth is OK). END $$;