summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index b59f52840..dd6ce96f4 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -145,6 +145,7 @@ import {
parsePaytoUri,
parseTalerUri,
performanceNow,
+ safeStringifyException,
sampleWalletCoreTransactions,
setDangerousTimetravel,
validateIban,
@@ -909,6 +910,7 @@ async function dispatchRequestInternal(
amount: Amounts.parseOrThrow(req.amount),
exchangeBaseUrl: req.exchangeBaseUrl,
restrictAge: req.restrictAge,
+ forceReservePriv: req.forceReservePriv,
});
return res;
}
@@ -1432,6 +1434,10 @@ async function dispatchRequestInternal(
await applyDevExperiment(wex, req.devExperimentUri);
return {};
}
+ case WalletApiOperation.Shutdown: {
+ wex.ws.stop();
+ return {};
+ }
case WalletApiOperation.GetVersion: {
return getVersion(wex);
}
@@ -1700,10 +1706,6 @@ export class Wallet {
return this.ws.addNotificationListener(f);
}
- stop(): void {
- this.ws.stop();
- }
-
async handleCoreApiRequest(
operation: string,
id: string,
@@ -1952,6 +1954,9 @@ export class InternalWalletState {
this.stopped = true;
this.timerGroup.stopCurrentAndFutureTimers();
this.cryptoDispatcher.stop();
+ this.taskScheduler.shutdown().catch((e) => {
+ logger.warn(`shutdown failed: ${safeStringifyException(e)}`);
+ });
}
/**