From 06e2e8022c01f2a2866eb79ed38552ef5ac2a6b2 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Sun, 19 Feb 2023 10:21:29 +0100
Subject: return KYC requirement row when AML imposed KYC requirements on
 withdraw; return KYC choices in new /config endpoint

---
 src/exchangedb/exchange_do_insert_aml_decision.sql | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src/exchangedb/exchange_do_insert_aml_decision.sql')

diff --git a/src/exchangedb/exchange_do_insert_aml_decision.sql b/src/exchangedb/exchange_do_insert_aml_decision.sql
index 00f803752..f257675a8 100644
--- a/src/exchangedb/exchange_do_insert_aml_decision.sql
+++ b/src/exchangedb/exchange_do_insert_aml_decision.sql
@@ -62,6 +62,7 @@ THEN
     SET threshold_val=in_new_threshold_val
        ,threshold_frac=in_new_threshold_frac
        ,status=in_new_status
+       ,kyc_requirement=in_requirement_row
    WHERE h_payto=in_h_payto;
   ASSERT FOUND, 'cannot have AML decision history but no AML status';
 ELSE
@@ -70,12 +71,14 @@ ELSE
     (h_payto
     ,threshold_val
     ,threshold_frac
-    ,status)
+    ,status
+    ,kyc_requirement)
     VALUES
     (in_h_payto
     ,in_new_threshold_val
     ,in_new_threshold_frac
-    ,in_new_status);
+    ,in_new_status
+    ,in_requirement_row);
 END IF;
 
 
-- 
cgit v1.2.3

