From d76bc2a03d3f9ccf9c9cf142bcb03c96bb40ddb5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 20 Aug 2019 23:36:56 +0200 Subject: more android helpers --- src/headless/helpers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/headless/helpers.ts') diff --git a/src/headless/helpers.ts b/src/headless/helpers.ts index 5636b3921..7c4fa8777 100644 --- a/src/headless/helpers.ts +++ b/src/headless/helpers.ts @@ -106,7 +106,7 @@ export class NodeHttpLib implements HttpRequestLibrary { } } -interface DefaultNodeWalletArgs { +export interface DefaultNodeWalletArgs { /** * Location of the wallet database. * @@ -155,6 +155,10 @@ export async function getDefaultNodeWallet( } myBackend.afterCommitCallback = async () => { + // Allow caller to stop persisting the wallet. + if (args.persistentStoragePath === undefined) { + return; + } const dbContent = myBackend.exportDump(); fs.writeFileSync(storagePath, JSON.stringify(dbContent, undefined, 2), { encoding: "utf-8" }); }; -- cgit v1.2.3