gnunet-svn
[Top][All Lists]
Advanced

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

[taler-typescript-core] branch master updated: wallet-core: fall back to


From: Admin
Subject: [taler-typescript-core] branch master updated: wallet-core: fall back to pending withdrawals for deposit account pub
Date: Thu, 05 Jun 2025 01:53:09 +0200

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 7c44ca864 wallet-core: fall back to pending withdrawals for deposit 
account pub
7c44ca864 is described below

commit 7c44ca8644c80770ec049e0c50b65801125e8553
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Jun 5 01:53:05 2025 +0200

    wallet-core: fall back to pending withdrawals for deposit account pub
    
    Issue: https://bugs.taler.net/n/10053
---
 packages/taler-wallet-core/src/deposits.ts | 38 ++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/packages/taler-wallet-core/src/deposits.ts 
b/packages/taler-wallet-core/src/deposits.ts
index 1532a6f97..12f02abc3 100644
--- a/packages/taler-wallet-core/src/deposits.ts
+++ b/packages/taler-wallet-core/src/deposits.ts
@@ -106,6 +106,7 @@ import {
   RefreshOperationStatus,
   WalletDbAllStoresReadOnlyTransaction,
   WalletDbReadWriteTransaction,
+  WithdrawalGroupStatus,
   timestampAbsoluteFromDb,
   timestampPreciseFromDb,
   timestampPreciseToDb,
@@ -1270,6 +1271,43 @@ async function getLastWithdrawalKeyPair(
         };
       }
     }
+
+    if (candidateRes) {
+      // We already found a good candidate.
+      return;
+    }
+
+    // No good candidate, try finding a withdrawal group that's at
+    // least currently pending, so it might be completed in the future.
+    for (const rec of withdrawalRecs) {
+      switch (rec.status) {
+        case WithdrawalGroupStatus.PendingBalanceKyc:
+        case WithdrawalGroupStatus.PendingBalanceKycInit:
+        case WithdrawalGroupStatus.PendingKyc:
+        case WithdrawalGroupStatus.PendingQueryingStatus:
+        case WithdrawalGroupStatus.PendingReady:
+        case WithdrawalGroupStatus.PendingRegisteringBank:
+        case WithdrawalGroupStatus.PendingWaitConfirmBank:
+        case WithdrawalGroupStatus.SuspendedBalanceKyc:
+        case WithdrawalGroupStatus.SuspendedBalanceKycInit:
+        case WithdrawalGroupStatus.SuspendedKyc:
+        case WithdrawalGroupStatus.SuspendedQueryingStatus:
+        case WithdrawalGroupStatus.SuspendedReady:
+        case WithdrawalGroupStatus.SuspendedRegisteringBank:
+        case WithdrawalGroupStatus.SuspendedWaitConfirmBank:
+      }
+      const currTimestamp = timestampAbsoluteFromDb(rec.timestampStart);
+      if (
+        candidateTimestamp == null ||
+        AbsoluteTime.cmp(currTimestamp, candidateTimestamp) > 0
+      ) {
+        candidateTimestamp = currTimestamp;
+        candidateRes = {
+          priv: rec.reservePriv,
+          pub: rec.reservePub,
+        };
+      }
+    }
   });
   return candidateRes;
 }

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