diff options
| author | Adam Soltys <[email protected]> | 2024-10-10 21:05:24 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-10 21:05:24 -0700 |
| commit | c6de0ae7abe22d23bb72e2bcbcfc9c08dca93018 (patch) | |
| tree | 68027963659c947893368edc745987a53b54d586 /routes | |
| parent | 2de34e3324e9ede75740b2e4beb984676623795d (diff) | |
| download | coinos-server-c6de0ae7abe22d23bb72e2bcbcfc9c08dca93018.tar.gz coinos-server-c6de0ae7abe22d23bb72e2bcbcfc9c08dca93018.zip | |
catch unload wallet error
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/users.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/routes/users.ts b/routes/users.ts index 06eb75ab..c0169f9c 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -15,7 +15,7 @@ import { mail, templates } from "$lib/mail"; import upload from "$lib/upload"; import rpc from "@coinos/rpc"; import { nip19 } from "nostr-tools"; -import { getCount, getProfile } from "$lib/nostr"; +import { getProfile } from "$lib/nostr"; export default { upload, @@ -128,7 +128,7 @@ export default { "prompt", "pubkey", "username", - "website" + "website", ]; if (user.pubkey) user.npub = nip19.npubEncode(user.pubkey); @@ -701,8 +701,12 @@ export default { let { id } = req.body; let { id: uid } = req.user; let { type } = await g(`account:${id}`); - let node = rpc({ ...config[type], wallet: id }); - await node.unloadWallet(id); + try { + let node = rpc({ ...config[type], wallet: id }); + await node.unloadWallet(id); + } catch (e) { + warn("failed to unload wallet", id); + } await db .multi() |
