summaryrefslogtreecommitdiff
path: root/src/headless/helpers.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-20 23:36:56 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-20 23:36:56 +0200
commitd76bc2a03d3f9ccf9c9cf142bcb03c96bb40ddb5 (patch)
tree83d3ce6ca77fef8bc5c6d21b03c845637210fcd7 /src/headless/helpers.ts
parent106bc6ad9a78c199e6b0e89bef854174d9014c28 (diff)
downloadwallet-core-d76bc2a03d3f9ccf9c9cf142bcb03c96bb40ddb5.tar.gz
wallet-core-d76bc2a03d3f9ccf9c9cf142bcb03c96bb40ddb5.tar.bz2
wallet-core-d76bc2a03d3f9ccf9c9cf142bcb03c96bb40ddb5.zip
more android helpers
Diffstat (limited to 'src/headless/helpers.ts')
-rw-r--r--src/headless/helpers.ts6
1 files changed, 5 insertions, 1 deletions
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" });
};