exchange

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

commit 1d99aea32b64cc9c02c32bc79434e0a4ce118a12
parent 659a701866ca9c04c9802624875f4b6dcf1ccc68
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Thu,  1 May 2025 13:19:57 +0200

style fixes, comments

Diffstat:
Msrc/exchangedb/exchange_do_withdraw.sql | 12++++++------
Msrc/exchangedb/pg_do_withdraw.c | 32++++++++++++++++----------------
2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/exchangedb/exchange_do_withdraw.sql b/src/exchangedb/exchange_do_withdraw.sql @@ -22,14 +22,14 @@ CREATE FUNCTION exchange_do_withdraw( IN in_now INT8, IN in_min_reserve_gc INT8, IN in_planchets_h BYTEA, - IN in_maximum_age_committed INT2, -- in years ϵ [0,1..) - IN in_noreveal_index INT2, - IN in_selected_h BYTEA, + IN in_maximum_age_committed INT2, -- in years ϵ [0,1..), possibly NULL + IN in_noreveal_index INT2, -- possibly NULL (if not age-withdraw) + IN in_selected_h BYTEA, -- possibly NULL (if not age-withdraw) IN in_denom_serials INT8[], IN in_denom_sigs BYTEA[], - IN in_blinding_seed BYTEA, - IN in_cs_r_values BYTEA[], - IN in_cs_r_choices INT8, + IN in_blinding_seed BYTEA, -- possibly NULL (if no CS denominations) + IN in_cs_r_values BYTEA[], -- possibly NULL (if no CS denominations) + IN in_cs_r_choices INT8, -- possibly NULL (if no CS denominations) OUT reserve_found BOOLEAN, OUT balance_ok BOOLEAN, OUT reserve_balance taler_amount, diff --git a/src/exchangedb/pg_do_withdraw.c b/src/exchangedb/pg_do_withdraw.c @@ -53,14 +53,14 @@ TEH_PG_do_withdraw ( GNUNET_PQ_query_param_timestamp (&gc), GNUNET_PQ_query_param_auto_from_type (&withdraw->planchets_h), (withdraw->age_proof_required) - ? GNUNET_PQ_query_param_uint16 (&withdraw->max_age) - : GNUNET_PQ_query_param_null (), + ? GNUNET_PQ_query_param_uint16 (&withdraw->max_age) + : GNUNET_PQ_query_param_null (), (withdraw->age_proof_required) - ? GNUNET_PQ_query_param_uint16 (&withdraw->noreveal_index) - : GNUNET_PQ_query_param_null (), + ? GNUNET_PQ_query_param_uint16 (&withdraw->noreveal_index) + : GNUNET_PQ_query_param_null (), (withdraw->age_proof_required) - ? GNUNET_PQ_query_param_auto_from_type (&withdraw->selected_h) - : GNUNET_PQ_query_param_null (), + ? GNUNET_PQ_query_param_auto_from_type (&withdraw->selected_h) + : GNUNET_PQ_query_param_null (), GNUNET_PQ_query_param_array_uint64 (withdraw->num_coins, withdraw->denom_serials, pg->conn), @@ -68,16 +68,16 @@ TEH_PG_do_withdraw ( withdraw->denom_sigs, pg->conn), (withdraw->no_blinding_seed) - ? GNUNET_PQ_query_param_null () - : GNUNET_PQ_query_param_auto_from_type (&withdraw->blinding_seed), - (0 < withdraw->num_cs_r_values) - ? TALER_PQ_query_param_array_cs_r_pub (withdraw->num_cs_r_values, - withdraw->cs_r_values, - pg->conn) - : GNUNET_PQ_query_param_null (), - (0 < withdraw->num_cs_r_values) - ? GNUNET_PQ_query_param_uint64 (&withdraw->cs_r_choices) - : GNUNET_PQ_query_param_null (), + ? GNUNET_PQ_query_param_null () + : GNUNET_PQ_query_param_auto_from_type (&withdraw->blinding_seed), + (withdraw->no_blinding_seed) + ? TALER_PQ_query_param_array_cs_r_pub (withdraw->num_cs_r_values, + withdraw->cs_r_values, + pg->conn) + : GNUNET_PQ_query_param_null (), + (withdraw->no_blinding_seed) + ? GNUNET_PQ_query_param_uint64 (&withdraw->cs_r_choices) + : GNUNET_PQ_query_param_null (), GNUNET_PQ_query_param_end }; bool reserve_found;