gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: fix pending operation query f


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix pending operation query for refunds
Date: Sat, 07 Dec 2019 20:35:54 +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 27e42111 fix pending operation query for refunds
27e42111 is described below

commit 27e42111e77b6f1ead1d0e341a3cfe9e4b68ecd3
Author: Florian Dold <address@hidden>
AuthorDate: Sat Dec 7 20:35:47 2019 +0100

    fix pending operation query for refunds
---
 src/wallet-impl/pending.ts | 54 +++++++++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 24 deletions(-)

diff --git a/src/wallet-impl/pending.ts b/src/wallet-impl/pending.ts
index 5fb9ef5c..729dcf12 100644
--- a/src/wallet-impl/pending.ts
+++ b/src/wallet-impl/pending.ts
@@ -366,14 +366,16 @@ async function gatherPurchasePending(
         now,
         pr.payRetryInfo.nextRetry,
       );
-      resp.pendingOperations.push({
-        type: "pay",
-        givesLifeness: true,
-        isReplay: false,
-        proposalId: pr.proposalId,
-        retryInfo: pr.payRetryInfo,
-        lastError: pr.lastPayError,
-      });
+      if (!onlyDue || pr.payRetryInfo.nextRetry.t_ms <= now.t_ms) {
+        resp.pendingOperations.push({
+          type: "pay",
+          givesLifeness: true,
+          isReplay: false,
+          proposalId: pr.proposalId,
+          retryInfo: pr.payRetryInfo,
+          lastError: pr.lastPayError,
+        });
+      }
     }
     if (pr.refundStatusRequested) {
       resp.nextRetryDelay = updateRetryDelay(
@@ -381,13 +383,15 @@ async function gatherPurchasePending(
         now,
         pr.refundStatusRetryInfo.nextRetry,
       );
-      resp.pendingOperations.push({
-        type: "refund-query",
-        givesLifeness: true,
-        proposalId: pr.proposalId,
-        retryInfo: pr.refundStatusRetryInfo,
-        lastError: pr.lastRefundStatusError,
-      });
+      if (!onlyDue || pr.refundStatusRetryInfo.nextRetry.t_ms <= now.t_ms) {
+        resp.pendingOperations.push({
+          type: "refund-query",
+          givesLifeness: true,
+          proposalId: pr.proposalId,
+          retryInfo: pr.refundStatusRetryInfo,
+          lastError: pr.lastRefundStatusError,
+        });
+      }
     }
     const numRefundsPending = Object.keys(pr.refundsPending).length;
     if (numRefundsPending > 0) {
@@ -397,15 +401,17 @@ async function gatherPurchasePending(
         now,
         pr.refundApplyRetryInfo.nextRetry,
       );
-      resp.pendingOperations.push({
-        type: "refund-apply",
-        numRefundsDone,
-        numRefundsPending,
-        givesLifeness: true,
-        proposalId: pr.proposalId,
-        retryInfo: pr.refundApplyRetryInfo,
-        lastError: pr.lastRefundApplyError,
-      });
+      if (!onlyDue || pr.refundApplyRetryInfo.nextRetry.t_ms <= now.t_ms) {
+        resp.pendingOperations.push({
+          type: "refund-apply",
+          numRefundsDone,
+          numRefundsPending,
+          givesLifeness: true,
+          proposalId: pr.proposalId,
+          retryInfo: pr.refundApplyRetryInfo,
+          lastError: pr.lastRefundApplyError,
+        });
+      }
     }
   });
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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