summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_batch-withdraw.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-11-14 06:43:21 +0100
committerChristian Grothoff <christian@grothoff.org>2022-11-14 06:43:21 +0100
commit41e3c1ecbf0c437f58be3084a9401aa71c515a62 (patch)
tree998358f3a2618a61ab58bc655e0bff039ca0c276 /src/exchange/taler-exchange-httpd_batch-withdraw.c
parent8bfc6583e799d8f7d0e55262b593183daed7f4fe (diff)
downloadexchange-41e3c1ecbf0c437f58be3084a9401aa71c515a62.tar.gz
exchange-41e3c1ecbf0c437f58be3084a9401aa71c515a62.tar.bz2
exchange-41e3c1ecbf0c437f58be3084a9401aa71c515a62.zip
implement batch operation in handlers
Diffstat (limited to 'src/exchange/taler-exchange-httpd_batch-withdraw.c')
-rw-r--r--src/exchange/taler-exchange-httpd_batch-withdraw.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/exchange/taler-exchange-httpd_batch-withdraw.c b/src/exchange/taler-exchange-httpd_batch-withdraw.c
index de1b67e52..a923784bf 100644
--- a/src/exchange/taler-exchange-httpd_batch-withdraw.c
+++ b/src/exchange/taler-exchange-httpd_batch-withdraw.c
@@ -413,24 +413,24 @@ static MHD_RESULT
prepare_transaction (const struct TEH_RequestContext *rc,
struct BatchWithdrawContext *wc)
{
- /* Note: We could check the reserve balance here,
- just to be reasonably sure that the reserve has
- a sufficient balance before doing the "expensive"
- signatures... */
- /* Sign before transaction! */
+ struct TEH_CoinSignData csds[wc->planchets_length];
+ struct TALER_BlindedDenominationSignature bss[wc->planchets_length];
+
for (unsigned int i = 0; i<wc->planchets_length; i++)
{
struct PlanchetContext *pc = &wc->planchets[i];
+
+ csds[i].h_denom_pub = &pc->collectable.denom_pub_hash;
+ csds[i].bp = &pc->blinded_planchet;
+ }
+ {
enum TALER_ErrorCode ec;
- struct TEH_CoinSignData csds = {
- .h_denom_pub = &pc->collectable.denom_pub_hash,
- .bp = &pc->blinded_planchet
- };
- ec = TEH_keys_denomination_sign (
- &csds,
+ ec = TEH_keys_denomination_batch_sign (
+ csds,
+ wc->planchets_length,
false,
- &pc->collectable.sig);
+ bss);
if (TALER_EC_NONE != ec)
{
GNUNET_break (0);
@@ -439,6 +439,12 @@ prepare_transaction (const struct TEH_RequestContext *rc,
NULL);
}
}
+ for (unsigned int i = 0; i<wc->planchets_length; i++)
+ {
+ struct PlanchetContext *pc = &wc->planchets[i];
+
+ pc->collectable.sig = bss[i];
+ }
/* run transaction */
{