aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/transactions.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-12-13 11:28:15 +0100
committerFlorian Dold <florian@dold.me>2021-12-13 11:28:15 +0100
commitc493a3069ec330b955efd8604cb9d8b76277c74e (patch)
tree32fb0ad5306f4e7000da4997c27a1abf3da96fcf /packages/taler-wallet-core/src/operations/transactions.ts
parent38d8239f937de047f127d37cd23ca6829db8e3e4 (diff)
downloadwallet-core-c493a3069ec330b955efd8604cb9d8b76277c74e.tar.xz
wallet-core: reset reserve retry when resetting withdrawal retry
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts34
1 files changed, 22 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts
index b00779fa2..106d72d02 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -19,12 +19,25 @@
*/
import {
AmountJson,
- Amounts, OrderShortInfo, PaymentStatus, timestampCmp, Transaction, TransactionsRequest,
- TransactionsResponse, TransactionType, WithdrawalDetails, WithdrawalType
+ Amounts,
+ Logger,
+ OrderShortInfo,
+ PaymentStatus,
+ timestampCmp,
+ Transaction,
+ TransactionsRequest,
+ TransactionsResponse,
+ TransactionType,
+ WithdrawalDetails,
+ WithdrawalType,
} from "@gnu-taler/taler-util";
import { InternalWalletState } from "../common.js";
import {
- AbortStatus, RefundState, ReserveRecord, ReserveRecordStatus, WalletRefundItem
+ AbortStatus,
+ RefundState,
+ ReserveRecord,
+ ReserveRecordStatus,
+ WalletRefundItem,
} from "../db.js";
import { processDepositGroup } from "./deposits.js";
import { getExchangeDetails } from "./exchanges.js";
@@ -34,6 +47,8 @@ import { getFundingPaytoUris } from "./reserves.js";
import { processTip } from "./tip.js";
import { processWithdrawGroup } from "./withdraw.js";
+const logger = new Logger("taler-wallet-core:transactions.ts");
+
/**
* Create an event ID from the type and the primary key for the event.
*/
@@ -404,13 +419,6 @@ export enum TombstoneTag {
DeleteRefund = "delete-refund",
}
-export async function retryTransactionNow(
- ws: InternalWalletState,
- transactionId: string,
-): Promise<void> {
- const [type, ...rest] = transactionId.split(":");
-}
-
/**
* Immediately retry the underlying operation
* of a transaction.
@@ -419,6 +427,8 @@ export async function retryTransaction(
ws: InternalWalletState,
transactionId: string,
): Promise<void> {
+ logger.info(`retrying transaction ${transactionId}`);
+
const [type, ...rest] = transactionId.split(":");
switch (type) {
@@ -478,8 +488,8 @@ export async function deleteTransaction(
const reserveRecord:
| ReserveRecord
| undefined = await tx.reserves.indexes.byInitialWithdrawalGroupId.get(
- withdrawalGroupId,
- );
+ withdrawalGroupId,
+ );
if (reserveRecord && !reserveRecord.initialWithdrawalStarted) {
const reservePub = reserveRecord.reservePub;
await tx.reserves.delete(reservePub);