gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: wallet-core: remove bogus exc


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: remove bogus exception
Date: Wed, 15 Nov 2023 23:41:08 +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 e4a1b373b wallet-core: remove bogus exception
e4a1b373b is described below

commit e4a1b373b018d7528828954ff8da96fe6b5f9728
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Nov 15 23:41:02 2023 +0100

    wallet-core: remove bogus exception
---
 packages/taler-wallet-core/src/operations/refresh.ts | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/packages/taler-wallet-core/src/operations/refresh.ts 
b/packages/taler-wallet-core/src/operations/refresh.ts
index 95aedbbd6..3afdd2d71 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -298,7 +298,7 @@ async function provideRefreshSession(
   const sessionSecretSeed = encodeCrock(getRandomBytes(64));
 
   // Store refresh session for this coin in the database.
-  const newSession = await ws.db
+  const mySession = await ws.db
     .mktx((x) => [x.refreshGroups, x.coins, x.refreshSessions])
     .runReadWrite(async (tx) => {
       const rg = await tx.refreshGroups.get(refreshGroupId);
@@ -310,7 +310,7 @@ async function provideRefreshSession(
         coinIndex,
       ]);
       if (existingSession) {
-        return;
+        return existingSession;
       }
       const newSession: RefreshSessionRecord = {
         coinIndex,
@@ -327,9 +327,9 @@ async function provideRefreshSession(
       return newSession;
     });
   logger.trace(
-    `created refresh session for coin #${coinIndex} in ${refreshGroupId}`,
+    `found/created refresh session for coin #${coinIndex} in 
${refreshGroupId}`,
   );
-  return newSession;
+  return mySession;
 }
 
 function getRefreshRequestTimeout(rg: RefreshGroupRecord): Duration {
@@ -918,11 +918,9 @@ async function processRefreshSession(
     refreshSession = await provideRefreshSession(ws, refreshGroupId, 
coinIndex);
   }
   if (!refreshSession) {
-    if (refreshGroup.statusPerCoin[coinIndex] !== RefreshCoinStatus.Finished) {
-      throw Error(
-        "BUG: refresh session was not created and coin not marked as finished",
-      );
-    }
+    // We tried to create the refresh session, but didn't get a result back.
+    // This means that either the session is finished, or that creating
+    // one isn't necessary.
     return;
   }
   if (refreshSession.norevealIndex === undefined) {

-- 
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]