From 46baa2937337ba251785a438befaae750bdc13b6 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 3 Jul 2025 13:27:17 -0700 Subject: [PATCH] Destroy accounts in safe asynchronously too. --- src/lib/account.ts | 4 ++-- src/lib/wallets/wallet.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/account.ts b/src/lib/account.ts index 315a8b8..2bc5c1d 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -72,8 +72,8 @@ export class Account { * Removes encrypted secrets in storage and releases variable references to * allow garbage collection. */ - destroy (): void { - Account.#poolSafe.assign({ + async destroy (): Promise { + await Account.#poolSafe.assign({ method: 'destroy', name: this.#pub }) diff --git a/src/lib/wallets/wallet.ts b/src/lib/wallets/wallet.ts index 726d20a..a883563 100644 --- a/src/lib/wallets/wallet.ts +++ b/src/lib/wallets/wallet.ts @@ -68,7 +68,7 @@ export abstract class Wallet { async destroy (): Promise { let i = 0 for (const a in this.#accounts) { - this.#accounts[a].destroy() + await this.#accounts[a].destroy() delete this.#accounts[a] i++ } -- 2.47.3