exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 2c163731575d42b4fe9c9b2b63c3800393dad810
parent d49d125e629057bcfd5c2dbd3f42d1bf6e17a85c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  5 Jun 2025 22:44:26 +0200

fix #10078

Diffstat:
Msrc/exchangedb/pg_select_exchange_credit_transfers.c | 8++++++++
Msrc/exchangedb/pg_select_exchange_debit_transfers.c | 8++++++++
Msrc/kyclogic/kyclogic_sanctions.c | 5+++--
3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/exchangedb/pg_select_exchange_credit_transfers.c b/src/exchangedb/pg_select_exchange_credit_transfers.c @@ -126,6 +126,8 @@ TEH_PG_select_exchange_credit_transfers ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_uint64 (&ulimit), + TALER_PQ_query_param_amount (pg->conn, + threshold), GNUNET_PQ_query_param_end }; enum GNUNET_DB_QueryStatus qs; @@ -141,6 +143,9 @@ TEH_PG_select_exchange_credit_transfers ( " LEFT JOIN wire_targets wt" " ON (ri.wire_source_h_payto = wt.wire_target_h_payto)" " WHERE (ri.reserve_in_serial_id > $1)" + " AND ( ( (ri.credit).val > ($3::taler_amount).val)" + " OR ( ( (ri.credit).val >= ($3::taler_amount).val)" + " AND ( (ri.credit).frac >= ($3::taler_amount).frac) ) )" " ORDER BY ri.reserve_in_serial_id ASC" " LIMIT $2"); PREPARE (pg, @@ -154,6 +159,9 @@ TEH_PG_select_exchange_credit_transfers ( " LEFT JOIN wire_targets wt" " ON (ri.wire_source_h_payto = wt.wire_target_h_payto)" " WHERE (ri.reserve_in_serial_id < $1)" + " AND ( ( (ri.credit).val > ($3::taler_amount).val)" + " OR ( ( (ri.credit).val >= ($3::taler_amount).val)" + " AND ( (ri.credit).frac >= ($3::taler_amount).frac) ) )" " ORDER BY ri.reserve_in_serial_id DESC" " LIMIT $2"); qs = GNUNET_PQ_eval_prepared_multi_select ( diff --git a/src/exchangedb/pg_select_exchange_debit_transfers.c b/src/exchangedb/pg_select_exchange_debit_transfers.c @@ -127,6 +127,8 @@ TEH_PG_select_exchange_debit_transfers ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_uint64 (&ulimit), + TALER_PQ_query_param_amount (pg->conn, + threshold), GNUNET_PQ_query_param_end }; enum GNUNET_DB_QueryStatus qs; @@ -142,6 +144,9 @@ TEH_PG_select_exchange_debit_transfers ( " LEFT JOIN wire_targets wt" " USING (wire_target_h_payto)" " WHERE (wo.wireout_uuid > $1)" + " AND ( ( (wo.amount).val > ($3::taler_amount).val)" + " OR ( ( (wo.amount).val >= ($3::taler_amount).val)" + " AND ( (wo.amount).frac >= ($3::taler_amount).frac) ) )" " ORDER BY wo.wireout_uuid ASC" " LIMIT $2"); PREPARE (pg, @@ -155,6 +160,9 @@ TEH_PG_select_exchange_debit_transfers ( " LEFT JOIN wire_targets wt" " USING (wire_target_h_payto)" " WHERE (wo.wireout_uuid < $1)" + " AND ( ( (wo.amount).val > ($3::taler_amount).val)" + " OR ( ( (wo.amount).val >= ($3::taler_amount).val)" + " AND ( (wo.amount).frac >= ($3::taler_amount).frac) ) )" " ORDER BY wo.wireout_uuid DESC" " LIMIT $2"); qs = GNUNET_PQ_eval_prepared_multi_select ( diff --git a/src/kyclogic/kyclogic_sanctions.c b/src/kyclogic/kyclogic_sanctions.c @@ -203,7 +203,6 @@ process_buffer (struct TALER_KYCLOGIC_SanctionRater *sr) char best_match[1024]; size_t line_len; - nl = memchr (buf, '\n', buf_len); @@ -233,7 +232,9 @@ process_buffer (struct TALER_KYCLOGIC_SanctionRater *sr) ee->cb (ee->cb_cls, TALER_EC_NONE, best_match, - GNUNET_TIME_timestamp_from_s (expire), + 0 == expire + ? GNUNET_TIME_UNIT_FOREVER_TS + : GNUNET_TIME_timestamp_from_s (expire), rating, confidence); free (ee->write_buf);