From 598de5b0d576987ea317b22fd6d33cbe4a1a19ac Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 18 Jan 2023 19:30:48 +0100 Subject: wallet-core: Add 'deposited' field to deposit transaction This field indicates whether the POST requests to deposit coins went through with the exchange. We also don't consider a deposit transaction as having lifeness when it is already deposited and we're just querying for informational deposit tracking information. --- packages/taler-wallet-core/src/operations/pending.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-core/src/operations/pending.ts') diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts index d9d62ec65..a73af528c 100644 --- a/packages/taler-wallet-core/src/operations/pending.ts +++ b/packages/taler-wallet-core/src/operations/pending.ts @@ -200,13 +200,22 @@ async function gatherDepositPending( if (dg.timestampFinished) { return; } + let deposited = true; + for (const d of dg.depositedPerCoin) { + if (!d) { + deposited = false; + } + } const opId = RetryTags.forDeposit(dg); const retryRecord = await tx.operationRetries.get(opId); const timestampDue = retryRecord?.retryInfo.nextRetry ?? AbsoluteTime.now(); resp.pendingOperations.push({ type: PendingTaskType.Deposit, ...getPendingCommon(ws, opId, timestampDue), - givesLifeness: true, + // Fully deposited operations don't give lifeness, + // because there is no reason to wait on the + // deposit tracking status. + givesLifeness: !deposited, depositGroupId: dg.depositGroupId, lastError: retryRecord?.lastError, retryInfo: retryRecord?.retryInfo, -- cgit v1.2.3