aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-01 17:49:50 -0700
committerAdam Soltys <[email protected]>2026-08-01 17:49:50 -0700
commit4ca5dd0afa7848d100f0b99be7b53f5dcb2fd061 (patch)
treef174344ded20ad4cef4315bed5c5f8f9d3bb9708 /tools
parenta64611377c646415bc0c21a8bb96b9a079c4ce2b (diff)
downloadcoinosv3-4ca5dd0afa7848d100f0b99be7b53f5dcb2fd061.tar.gz
coinosv3-4ca5dd0afa7848d100f0b99be7b53f5dcb2fd061.zip
Never let a losing device's error shout over a paid zap
Loose leader election for pay_invoice across a user's open tabs: before handling, defer a beat and stay silent if any reply for the request already exists on the relays; and before sending an ERROR reply, re-check — a device that lost the race (mid-init, stale state) was replying 'superseded' after another device's success, and clients trusted the later error, marking paid zaps as failed. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/nwc-test.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/nwc-test.js b/tools/nwc-test.js
index 7b7f8c3..d1d0cbc 100644
--- a/tools/nwc-test.js
+++ b/tools/nwc-test.js
@@ -18,6 +18,7 @@ const published = [];
const nwcTransport = {
subscribe: (relays, filter, on) => { subHandler = on; return () => { subHandler = null; }; },
publish: async (relays, evt) => { published.push(evt); return true; },
+ query: async () => [], // no other device has answered anything in tests
};
let paid = [];
const wallet = {