gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: -only return coin indices for


From: gnunet
Subject: [taler-wallet-core] branch master updated: -only return coin indices for successfully withdrawn coins
Date: Fri, 10 Feb 2023 19:23:24 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 49608f0bb -only return coin indices for successfully withdrawn coins
49608f0bb is described below

commit 49608f0bbb7c5d54cd64442f5d249710475cc1e5
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri Feb 10 13:40:57 2023 +0100

    -only return coin indices for successfully withdrawn coins
---
 packages/taler-wallet-core/src/operations/withdraw.ts | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts 
b/packages/taler-wallet-core/src/operations/withdraw.ts
index c2fcf05e8..c741f7703 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -492,7 +492,7 @@ async function processPlanchetExchangeBatchRequest(
 
   const batchReq: ExchangeBatchWithdrawRequest = { planchets: [] };
   // Indices of coins that are included in the batch request
-  const coinIdxs: number[] = [];
+  const requestCoinIdxs: number[] = [];
 
   await ws.db
     .mktx((x) => [
@@ -537,7 +537,7 @@ async function processPlanchetExchangeBatchRequest(
           coin_ev: planchet.coinEv,
         };
         batchReq.planchets.push(planchetReq);
-        coinIdxs.push(coinIdx);
+        requestCoinIdxs.push(coinIdx);
       }
     });
 
@@ -563,7 +563,7 @@ async function processPlanchetExchangeBatchRequest(
         for (let i = startIdx; i < coinIdxs.length; i++) {
           let planchet = await tx.planchets.indexes.byGroupAndIndex.get([
             withdrawalGroup.withdrawalGroupId,
-            coinIdxs[i],
+            requestCoinIdxs[i],
           ]);
           if (!planchet) {
             continue;
@@ -623,11 +623,11 @@ async function processPlanchetExchangeBatchRequest(
         codecForWithdrawBatchResponse(),
       );
       return {
-        coinIdxs,
+        coinIdxs: requestCoinIdxs,
         batchResp: r,
       };
     } catch (e) {
-      await storeCoinError(e, coinIdxs[0]);
+      await storeCoinError(e, requestCoinIdxs[0]);
       return {
         batchResp: { ev_sigs: [] },
         coinIdxs: [],
@@ -638,6 +638,7 @@ async function processPlanchetExchangeBatchRequest(
     const responses: ExchangeWithdrawBatchResponse = {
       ev_sigs: [],
     };
+    const responseCoinIdxs: number[] = [];
     for (let i = 0; i < batchReq.planchets.length; i++) {
       try {
         const p = batchReq.planchets[i];
@@ -650,7 +651,7 @@ async function processPlanchetExchangeBatchRequest(
           await handleKycRequired(resp, i);
           // We still return blinded coins that we could actually withdraw.
           return {
-            coinIdxs,
+            coinIdxs: responseCoinIdxs,
             batchResp: responses,
           };
         }
@@ -659,12 +660,13 @@ async function processPlanchetExchangeBatchRequest(
           codecForWithdrawResponse(),
         );
         responses.ev_sigs.push(r);
+        responseCoinIdxs.push(requestCoinIdxs[i]);
       } catch (e) {
-        await storeCoinError(e, coinIdxs[i]);
+        await storeCoinError(e, requestCoinIdxs[i]);
       }
     }
     return {
-      coinIdxs,
+      coinIdxs: responseCoinIdxs,
       batchResp: responses,
     };
   }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]