From dd1489303f59ccef6b322142f94e08d750c06e79 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 14 Sep 2026 09:16:23 -0700 Subject: A zap answers as fast as the route allows. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01QYJfZ4A1TDCEY4Foq3CApR --- tools/nwc-test.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools') diff --git a/tools/nwc-test.js b/tools/nwc-test.js index b68a89b..9189d52 100644 --- a/tools/nwc-test.js +++ b/tools/nwc-test.js @@ -144,6 +144,15 @@ console.log('\n[cross-device claim]'); claimOk = true; r = await request('get_balance', {}); check('non-pay methods need no claim', r?.result?.balance === 42000*1000); + // no verdict from the notifier → the relay look-back decides + claimOk = null; priorReplies = [{ id: 'x' }]; + const n2 = published.length; + await request('pay_invoice', { invoice: INV21 }); + check('no verdict + a reply on the relays → silent', published.length === n2); + priorReplies = []; + r = await request('pay_invoice', { invoice: INV21 }); + check('no verdict + nothing on the relays → pays', !!r?.result?.preimage); + claimOk = true; } console.log('\n[nip04 fallback]'); -- cgit v1.2.3