From aaafe91a4a2b438f3f52472492503601d05f2546 Mon Sep 17 00:00:00 2001 From: redshift <213178690+1ftredsh@users.noreply.github.com> Date: Mon, 13 Jul 2026 20:32:02 +0800 Subject: [PATCH] fix(wallet): let coco recover failed operations --- src/daemon/wallet/coco-client.ts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/daemon/wallet/coco-client.ts b/src/daemon/wallet/coco-client.ts index d16f130..c0e63b9 100644 --- a/src/daemon/wallet/coco-client.ts +++ b/src/daemon/wallet/coco-client.ts @@ -387,13 +387,8 @@ export async function createCocoClient( mintUrl: targetMint, amount, }); - try { - const { token } = await coco.ops.send.execute(prepared.id); - return getEncodedToken(token); - } catch (error) { - await coco.ops.send.cancel(prepared.id); - throw error; - } + const { token } = await coco.ops.send.execute(prepared.id); + return getEncodedToken(token); }, async sendBolt11(invoice: string, mintUrl?: string): Promise { @@ -407,13 +402,8 @@ export async function createCocoClient( method: "bolt11", methodData: { invoice }, }); - try { - await coco.ops.melt.execute(prepared.id); - return "Payment sent successfully"; - } catch (error) { - await coco.ops.melt.cancel(prepared.id); - throw error; - } + await coco.ops.melt.execute(prepared.id); + return "Payment sent successfully"; }, async listMints(): Promise {