From 2337ddab6126722b46a0ea0b6e244955a38b09df Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 23 Sep 2022 21:47:38 +0200 Subject: wallet-core: fix withdrawal state machine --- packages/taler-wallet-core/src/operations/withdraw.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-core/src/operations') diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 4901fdc86..461b96079 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -1023,7 +1023,7 @@ async function queryReserve( logger.warn(`withdrawal group ${withdrawalGroupId} not found`); return; } - wg.status = WithdrawalGroupStatus.Finished; + wg.status = WithdrawalGroupStatus.Ready; await tx.withdrawalGroups.put(wg); }); @@ -1138,6 +1138,9 @@ export async function processWithdrawalGroup( case WithdrawalGroupStatus.Finished: // We can try to withdraw, nothing needs to be done with the reserve. break; + case WithdrawalGroupStatus.Ready: + // Continue with the actual withdrawal! + break; default: throw new InvariantViolatedError( `unknown reserve record status: ${withdrawalGroup.status}`, -- cgit v1.2.3