aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_do_batch_withdraw.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-10-15 23:30:51 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-10-15 23:30:51 +0200
commit917dd4d70ff2f38d475146b387e649a669996f10 (patch)
tree2550f23c5d9418bdaae7c5b7b328d9e5c60e226b /src/exchangedb/pg_do_batch_withdraw.c
parentc72cf2ce10017dccc342c4ea86ac2b006aa54149 (diff)
downloadexchange-917dd4d70ff2f38d475146b387e649a669996f10.tar.xz
avoid extra transaction to fetch balance if reserve is out of funds, remove legacy /withdraw endpoint
Diffstat (limited to 'src/exchangedb/pg_do_batch_withdraw.c')
-rw-r--r--src/exchangedb/pg_do_batch_withdraw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/exchangedb/pg_do_batch_withdraw.c b/src/exchangedb/pg_do_batch_withdraw.c
index f89f32775..f5571ddbb 100644
--- a/src/exchangedb/pg_do_batch_withdraw.c
+++ b/src/exchangedb/pg_do_batch_withdraw.c
@@ -36,6 +36,7 @@ TEH_PG_do_batch_withdraw (
bool do_age_check,
bool *found,
bool *balance_ok,
+ struct TALER_Amount *reserve_balance,
bool *age_ok,
uint16_t *allowed_maximum_age,
uint64_t *ruuid)
@@ -56,6 +57,8 @@ TEH_PG_do_batch_withdraw (
found),
GNUNET_PQ_result_spec_bool ("balance_ok",
balance_ok),
+ TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_balance",
+ reserve_balance),
GNUNET_PQ_result_spec_bool ("age_ok",
age_ok),
GNUNET_PQ_result_spec_uint16 ("allowed_maximum_age",
@@ -73,6 +76,7 @@ TEH_PG_do_batch_withdraw (
"SELECT "
" reserve_found"
",balance_ok"
+ ",reserve_balance"
",age_ok"
",allowed_maximum_age"
",ruuid"