diff options
| author | Adam Soltys <[email protected]> | 2026-09-14 08:53:35 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-14 08:53:35 -0700 |
| commit | 6394de43d4e596aaeddd2b262bb7a595679d8fbc (patch) | |
| tree | 391f79322f788955985ad149d02e60111aa6ea42 /src/features/ark.js | |
| parent | 4131e5ee24c4891caffdd8f4ca903ee973d104f7 (diff) | |
| download | coinosv3-6394de43d4e596aaeddd2b262bb7a595679d8fbc.tar.gz coinosv3-6394de43d4e596aaeddd2b262bb7a595679d8fbc.zip | |
A zap answered by two tabs no longer reports as failed.
Every open tab of the same wallet sees every wallet-connect request. Two
hidden tabs on one laptop both tried to pay the same zap: the ASP refused
the second with "payment already in progress", and that error reached
Amethyst half a second before the first tab's preimage. A Web Lock per
request now lets one tab (or the worker) answer while the rest stay
quiet, and a device that does meet "already in progress" waits for the
sibling payment's outcome — relaying its preimage only if the payer never
speaks — instead of shouting a failure over sats that went through. The
losing side also stops writing a failed row into history for it.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QYJfZ4A1TDCEY4Foq3CApR
Diffstat (limited to 'src/features/ark.js')
| -rw-r--r-- | src/features/ark.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/features/ark.js b/src/features/ark.js index 222b312..e9c93b1 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -3181,6 +3181,12 @@ export function arkFeature(ctx) { startLnPay(invoice, meta) { return startArkLnPay(invoice, meta); }, // ---- headless seam for the NWC wallet service ---- arkPayInvoice(invoice, opts) { return payInvoiceHeadless(invoice, opts); }, + // The settled outcome of a payment another device of this wallet + // started (the ASP refuses a second HTLC for the same invoice). + async arkLnOutcome(paymentHash, timeoutMs) { + const mgr = await connectArk(); + return mgr.lnOutcome(paymentHash, timeoutMs); + }, arkSpendableSat() { const b = arkBalance(); return b ? b.spendableSat : 0; }, arkReady() { return arkAvailable(); }, async arkMakeInvoice(amountSat, description) { |
