diff options
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/backup/index.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/deposits.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/exchanges.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/pay-merchant.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-pull-credit.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-pull-debit.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-push-credit.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-push-debit.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/recoup.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/refresh.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/withdraw.ts | 4 |
11 files changed, 44 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/backup/index.ts b/packages/taler-wallet-core/src/backup/index.ts index 09d5ae75d..c5febd278 100644 --- a/packages/taler-wallet-core/src/backup/index.ts +++ b/packages/taler-wallet-core/src/backup/index.ts @@ -427,6 +427,10 @@ export async function processBackupForProvider( wex: WalletExecutionContext, backupProviderBaseUrl: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + const provider = await wex.db.runReadOnlyTx( { storeNames: ["backupProviders"] }, async (tx) => { diff --git a/packages/taler-wallet-core/src/deposits.ts b/packages/taler-wallet-core/src/deposits.ts index 855db836a..36ebf3974 100644 --- a/packages/taler-wallet-core/src/deposits.ts +++ b/packages/taler-wallet-core/src/deposits.ts @@ -1190,6 +1190,10 @@ export async function processDepositGroup( wex: WalletExecutionContext, depositGroupId: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + const depositGroup = await wex.db.runReadOnlyTx( { storeNames: ["depositGroups"] }, async (tx) => { diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts index 4043d3498..8fa439715 100644 --- a/packages/taler-wallet-core/src/exchanges.ts +++ b/packages/taler-wallet-core/src/exchanges.ts @@ -1301,6 +1301,10 @@ export async function updateExchangeFromUrlHandler( wex: WalletExecutionContext, exchangeBaseUrl: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + logger.trace(`updating exchange info for ${exchangeBaseUrl}`); const oldExchangeRec = await wex.db.runReadOnlyTx( diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts index 76c96925f..efe6f6638 100644 --- a/packages/taler-wallet-core/src/pay-merchant.ts +++ b/packages/taler-wallet-core/src/pay-merchant.ts @@ -2109,6 +2109,10 @@ export async function processPurchase( }; } + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + switch (purchase.purchaseStatus) { case PurchaseStatus.PendingDownloadingProposal: return processDownloadProposal(wex, proposalId); diff --git a/packages/taler-wallet-core/src/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/pay-peer-pull-credit.ts index 588fe5c11..2ddebab29 100644 --- a/packages/taler-wallet-core/src/pay-peer-pull-credit.ts +++ b/packages/taler-wallet-core/src/pay-peer-pull-credit.ts @@ -779,6 +779,10 @@ export async function processPeerPullCredit( wex: WalletExecutionContext, pursePub: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + const pullIni = await wex.db.runReadOnlyTx( { storeNames: ["peerPullCredit"] }, async (tx) => { diff --git a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts index a1c6b46ce..4ad324359 100644 --- a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts +++ b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts @@ -652,6 +652,10 @@ export async function processPeerPullDebit( wex: WalletExecutionContext, peerPullDebitId: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + const peerPullInc = await wex.db.runReadOnlyTx( { storeNames: ["peerPullDebit"] }, async (tx) => { diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts index 02b07c429..bd4adc0b6 100644 --- a/packages/taler-wallet-core/src/pay-peer-push-credit.ts +++ b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -857,6 +857,10 @@ export async function processPeerPushCredit( wex: WalletExecutionContext, peerPushCreditId: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + let peerInc: PeerPushPaymentIncomingRecord | undefined; let contractTerms: PeerContractTerms | undefined; await wex.db.runReadWriteTx( diff --git a/packages/taler-wallet-core/src/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/pay-peer-push-debit.ts index c04d37f1c..f6bc605a0 100644 --- a/packages/taler-wallet-core/src/pay-peer-push-debit.ts +++ b/packages/taler-wallet-core/src/pay-peer-push-debit.ts @@ -1042,6 +1042,10 @@ export async function processPeerPushDebit( wex: WalletExecutionContext, pursePub: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + const peerPushInitiation = await wex.db.runReadOnlyTx( { storeNames: ["peerPushDebit"] }, async (tx) => { diff --git a/packages/taler-wallet-core/src/recoup.ts b/packages/taler-wallet-core/src/recoup.ts index 56c819bf8..43e9af625 100644 --- a/packages/taler-wallet-core/src/recoup.ts +++ b/packages/taler-wallet-core/src/recoup.ts @@ -296,6 +296,10 @@ export async function processRecoupGroup( wex: WalletExecutionContext, recoupGroupId: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + let recoupGroup = await wex.db.runReadOnlyTx( { storeNames: ["recoupGroups"] }, async (tx) => { diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts index 9a5058a4d..f782d2445 100644 --- a/packages/taler-wallet-core/src/refresh.ts +++ b/packages/taler-wallet-core/src/refresh.ts @@ -1324,6 +1324,10 @@ export async function processRefreshGroup( wex: WalletExecutionContext, refreshGroupId: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + logger.trace(`processing refresh group ${refreshGroupId}`); const refreshGroup = await wex.db.runReadOnlyTx( diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts index 981c85ba4..dc27d61d2 100644 --- a/packages/taler-wallet-core/src/withdraw.ts +++ b/packages/taler-wallet-core/src/withdraw.ts @@ -2175,6 +2175,10 @@ export async function processWithdrawalGroup( wex: WalletExecutionContext, withdrawalGroupId: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + logger.trace("processing withdrawal group", withdrawalGroupId); const withdrawalGroup = await wex.db.runReadOnlyTx( { storeNames: ["withdrawalGroups"] }, |