diff options
| author | Adam Soltys <[email protected]> | 2026-09-14 09:16:23 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-14 09:16:23 -0700 |
| commit | dd1489303f59ccef6b322142f94e08d750c06e79 (patch) | |
| tree | eecccbeb577b873b855766f8e064622ce5c2f2dc /src/nwc-respond.js | |
| parent | 671d2a96474f59ca9234c876ce6604d03de95727 (diff) | |
| download | coinosv3-dd1489303f59ccef6b322142f94e08d750c06e79.tar.gz coinosv3-dd1489303f59ccef6b322142f94e08d750c06e79.zip | |
A zap answers as fast as the route allows.
The wallet used to add two to four seconds of its own around a Lightning
send: a random pause plus a relay look-back before paying, and a
two-second poll for the result after. The notifier's claim now decides
who pays in one round trip, with the relay look-back kept only for
replays and for when the notifier gives no verdict; a phone answering
from behind another app waits a second so a desktop tab wins the claim
instead of paying at a throttled crawl. After the send, one held
CheckLightningPayment call brings the preimage the moment CLN has it —
for wallet-connect pays, the background worker, and the app's own Send.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QYJfZ4A1TDCEY4Foq3CApR
Diffstat (limited to 'src/nwc-respond.js')
| -rw-r--r-- | src/nwc-respond.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nwc-respond.js b/src/nwc-respond.js index bab25b0..0ebf361 100644 --- a/src/nwc-respond.js +++ b/src/nwc-respond.js @@ -291,7 +291,7 @@ export async function respondFromBg(data, { } catch (e) { return failQuietly(e.message); } - a = mgr.lnAction(id); + a = await mgr.awaitLnPay(id, Math.max(1000, deadline - Date.now())).catch(() => mgr.lnAction(id)); while (a && !['done', 'failed'].includes(a.step) && Date.now() < deadline) { await new Promise((r) => setTimeout(r, 1500)); await mgr.driveLn(id).catch(() => {}); |
