aboutsummaryrefslogtreecommitdiff
path: root/src/headless/helpers.ts
diff options
context:
space:
mode:
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" });
};