diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/backup')
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/index.ts | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/index.ts b/packages/taler-wallet-core/src/operations/backup/index.ts index eef838b0c..a44e8f55a 100644 --- a/packages/taler-wallet-core/src/operations/backup/index.ts +++ b/packages/taler-wallet-core/src/operations/backup/index.ts @@ -368,10 +368,7 @@ async function runBackupCycleForProvider( } } - if ( - res === undefined || - res.status === PreparePayResultType.AlreadyConfirmed - ) { + if (res === undefined) { //claimed await ws.db @@ -400,10 +397,6 @@ async function runBackupCycleForProvider( } const result = res; - if (result.status === PreparePayResultType.Lost) { - throw Error("invalid state, could not get proposal for backup"); - } - await ws.db .mktx((x) => [x.backupProviders, x.operationRetries]) .runReadWrite(async (tx) => { @@ -890,7 +883,13 @@ async function getProviderPaymentInfo( const status = await checkPaymentByProposalId( ws, provider.currentPaymentProposalId, - ); + ).catch(() => undefined); + + if (!status) { + return { + type: ProviderPaymentType.Unpaid, + }; + } switch (status.status) { case PreparePayResultType.InsufficientBalance: @@ -903,10 +902,6 @@ async function getProviderPaymentInfo( type: ProviderPaymentType.Pending, talerUri: status.talerUri, }; - case PreparePayResultType.Lost: - return { - type: ProviderPaymentType.Unpaid, - }; case PreparePayResultType.AlreadyConfirmed: if (status.paid) { return { |