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: fix computation


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: fix computation of timestamp for exchange update
Date: Wed, 08 Dec 2021 01:52:59 +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 02bbf082 wallet-core: fix computation of timestamp for exchange update
02bbf082 is described below

commit 02bbf082832d6ad4f6099b2aa2e3ebf8b081350c
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Dec 8 01:52:24 2021 +0100

    wallet-core: fix computation of timestamp for exchange update
---
 packages/taler-wallet-core/src/db.ts                 |  4 ++++
 packages/taler-wallet-core/src/operations/pending.ts | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/packages/taler-wallet-core/src/db.ts 
b/packages/taler-wallet-core/src/db.ts
index 4296d050..07e0f4b0 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -539,6 +539,10 @@ export interface ExchangeRecord {
    */
   nextRefreshCheck: Timestamp;
 
+  /**
+   * Last error (if any) for fetching updated information about the
+   * exchange.
+   */
   lastError?: TalerErrorDetails;
 
   /**
diff --git a/packages/taler-wallet-core/src/operations/pending.ts 
b/packages/taler-wallet-core/src/operations/pending.ts
index a87b1c8b..e3d22bfe 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -52,10 +52,18 @@ async function gatherExchangePending(
   resp: PendingOperationsResponse,
 ): Promise<void> {
   await tx.exchanges.iter().forEachAsync(async (e) => {
+    let exchangeUpdateTimestampDue: Timestamp;
+
+    if (e.lastError) {
+      exchangeUpdateTimestampDue = e.retryInfo.nextRetry;
+    } else {
+      exchangeUpdateTimestampDue = e.nextUpdate;
+    }
+
     resp.pendingOperations.push({
       type: PendingTaskType.ExchangeUpdate,
       givesLifeness: false,
-      timestampDue: e.nextUpdate,
+      timestampDue: exchangeUpdateTimestampDue,
       exchangeBaseUrl: e.baseUrl,
       lastError: e.lastError,
     });

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