From 917dd4d70ff2f38d475146b387e649a669996f10 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 15 Oct 2023 23:30:51 +0200 Subject: avoid extra transaction to fetch balance if reserve is out of funds, remove legacy /withdraw endpoint --- src/exchangedb/pg_do_batch_withdraw.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/exchangedb/pg_do_batch_withdraw.c') 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" -- cgit v1.2.3