From d3c509fcd91e5b7e430eda767108d961db196522 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Fri, 7 Oct 2022 09:59:39 +0200 Subject: WIP: Added policy extension handling during deposit --- src/exchangedb/plugin_exchangedb_postgres.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/exchangedb/plugin_exchangedb_postgres.c') diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 34ff0bd5..e03713c3 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -822,8 +822,8 @@ prepare_statements (struct PostgresClosure *pg) ",out_balance_ok AS balance_ok" ",out_conflict AS conflicted" " FROM exchange_do_deposit" - " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17);", - 17), + " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19);", + 19), /* used in postgres_do_purse_deposit() */ GNUNET_PQ_make_prepare ( "call_purse_deposit", @@ -6252,7 +6252,6 @@ postgres_do_deposit ( const struct TALER_EXCHANGEDB_Deposit *deposit, uint64_t known_coin_id, const struct TALER_PaytoHashP *h_payto, - bool policy_blocked, struct GNUNET_TIME_Timestamp *exchange_timestamp, bool *balance_ok, bool *in_conflict) @@ -6274,10 +6273,16 @@ postgres_do_deposit ( GNUNET_PQ_query_param_auto_from_type (&deposit->coin.coin_pub), GNUNET_PQ_query_param_auto_from_type (&deposit->csig), GNUNET_PQ_query_param_uint64 (&deposit_shard), - GNUNET_PQ_query_param_bool (policy_blocked), - (NULL == deposit->policy_details) + GNUNET_PQ_query_param_bool (! deposit->no_policy_details), + (deposit->no_policy_details) ? GNUNET_PQ_query_param_null () : TALER_PQ_query_param_json (deposit->policy_details), + (deposit->no_policy_details) + ? GNUNET_PQ_query_param_null () + : GNUNET_PQ_query_param_auto_from_type (&deposit->policy_serial_id), + (deposit->no_policy_details) + ? GNUNET_PQ_query_param_null () + : GNUNET_PQ_query_param_timestamp (&deposit->policy_deadline), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { -- cgit v1.2.3