summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-08-07 17:59:06 +0200
committerFlorian Dold <florian@dold.me>2021-08-07 17:59:06 +0200
commitc077c0d8c08fb83fb6f4ba860a9d600cc22131c3 (patch)
tree89cebd2c3962f843842a88019543416bbc96c793 /packages/taler-wallet-core/src
parent15eea5da9f260d9a4b72ad2314fef166737f146c (diff)
downloadwallet-core-c077c0d8c08fb83fb6f4ba860a9d600cc22131c3.tar.gz
wallet-core-c077c0d8c08fb83fb6f4ba860a9d600cc22131c3.tar.bz2
wallet-core-c077c0d8c08fb83fb6f4ba860a9d600cc22131c3.zip
consider deposit operations for pending operations
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r--packages/taler-wallet-core/src/operations/pending.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts
index 3a6af186e..200e6ccbd 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -180,6 +180,27 @@ async function gatherProposalPending(
});
}
+async function gatherDepositPending(
+ tx: GetReadOnlyAccess<{ depositGroups: typeof WalletStoresV1.depositGroups }>,
+ now: Timestamp,
+ resp: PendingOperationsResponse,
+): Promise<void> {
+ await tx.depositGroups.iter().forEach((dg) => {
+ if (dg.timestampFinished) {
+ return;
+ }
+ const timestampDue = dg.retryInfo?.nextRetry ?? getTimestampNow();
+ resp.pendingOperations.push({
+ type: PendingTaskType.Deposit,
+ givesLifeness: true,
+ timestampDue,
+ depositGroupId: dg.depositGroupId,
+ lastError: dg.lastError,
+ retryInfo: dg.retryInfo,
+ });
+ });
+}
+
async function gatherTipPending(
tx: GetReadOnlyAccess<{ tips: typeof WalletStoresV1.tips }>,
now: Timestamp,
@@ -313,6 +334,7 @@ export async function getPendingOperations(
await gatherRefreshPending(tx, now, resp);
await gatherWithdrawalPending(tx, now, resp);
await gatherProposalPending(tx, now, resp);
+ await gatherDepositPending(tx, now, resp);
await gatherTipPending(tx, now, resp);
await gatherPurchasePending(tx, now, resp);
await gatherRecoupPending(tx, now, resp);