aboutsummaryrefslogtreecommitdiffstats
path: root/src/nostr.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-01 12:28:20 -0700
committerAdam Soltys <[email protected]>2026-08-01 12:28:20 -0700
commitcdfda57c06e60ea235e54815a7734ad66484016f (patch)
tree9714ce2e78beb982bd12a68daaf3633a8a237903 /src/nostr.js
parent0bada8cc01cff45060b2589716b180f166ef489c (diff)
downloadcoinosv3-cdfda57c06e60ea235e54815a7734ad66484016f.tar.gz
coinosv3-cdfda57c06e60ea235e54815a7734ad66484016f.zip
Instrument the silent NWC request-drop paths
Every guard in onRequest now names itself when it drops an event, and listen()/stop() log subscription generations so a later listen() killing the live sub becomes visible. subscribeOn passes extra params through so relay-initiated CLOSED reasons surface too. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/nostr.js')
-rw-r--r--src/nostr.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nostr.js b/src/nostr.js
index 1a86499..0b902e1 100644
--- a/src/nostr.js
+++ b/src/nostr.js
@@ -27,9 +27,9 @@ const pool = new SimplePool();
// feature's configuration. NWC needs this: the relays it advertises in a
// connection URI must be exactly the ones it listens on, or a client's
// request lands somewhere the wallet isn't and it waits forever.
-export function subscribeOn(relays, filter, onEvent) {
+export function subscribeOn(relays, filter, onEvent, extra = {}) {
try {
- const sub = pool.subscribeMany(relays, [filter], { onevent: onEvent });
+ const sub = pool.subscribeMany(relays, [filter], { onevent: onEvent, ...extra });
return () => { try { sub.close(); } catch {} };
} catch { return () => {}; }
}