aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-04 21:54:47 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-04 21:54:47 +0100
commit5a18e955ebd663a6e1318378002a6368a7c07566 (patch)
tree9f1d6349f36bf053253382705e2032e8e738c5ba /src/exchangedb
parent47b9ef598dc33e10294c1af4c7cf0e2ac71f553e (diff)
downloadexchange-5a18e955ebd663a6e1318378002a6368a7c07566.tar.xz
-fix AML decision update logic and history fetch logic
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/0003-aml_history.sql2
-rw-r--r--src/exchangedb/pg_select_aml_process.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/exchangedb/0003-aml_history.sql b/src/exchangedb/0003-aml_history.sql
index 1c737265b..36c0b3865 100644
--- a/src/exchangedb/0003-aml_history.sql
+++ b/src/exchangedb/0003-aml_history.sql
@@ -26,7 +26,7 @@ BEGIN
PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I'
'(aml_history_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
- ',h_payto BYTEA PRIMARY KEY CHECK (LENGTH(h_payto)=32)'
+ ',h_payto BYTEA CHECK (LENGTH(h_payto)=32)'
',new_threshold_val INT8 NOT NULL DEFAULT(0)'
',new_threshold_frac INT4 NOT NULL DEFAULT(0)'
',new_status INT4 NOT NULL DEFAULT(0)'
diff --git a/src/exchangedb/pg_select_aml_process.c b/src/exchangedb/pg_select_aml_process.c
index 6ee0dbeb9..5df5fe657 100644
--- a/src/exchangedb/pg_select_aml_process.c
+++ b/src/exchangedb/pg_select_aml_process.c
@@ -140,25 +140,25 @@ TEH_PG_select_aml_process (
"SELECT"
" aml_status_serial_id"
",h_payto"
- ",threshold_var"
+ ",threshold_val"
",threshold_frac"
",status"
" FROM aml_status"
" WHERE aml_status_serial_id > $2"
" AND status = $1"
- " ORDER BY aml_status_serial_id INC"
+ " ORDER BY aml_status_serial_id ASC"
" LIMIT $3");
PREPARE (pg,
"select_aml_process_dec",
"SELECT"
" aml_status_serial_id"
",h_payto"
- ",threshold_var"
+ ",threshold_val"
",threshold_frac"
",status"
" FROM aml_status"
" WHERE aml_status_serial_id < $2"
- " AND $1 = status & $1"
+ " AND status = $1"
" ORDER BY aml_status_serial_id DESC"
" LIMIT $3");
qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,