diff options
| author | Adam Soltys <[email protected]> | 2026-08-01 12:28:20 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-01 12:28:20 -0700 |
| commit | cdfda57c06e60ea235e54815a7734ad66484016f (patch) | |
| tree | 9714ce2e78beb982bd12a68daaf3633a8a237903 /src/nostr.js | |
| parent | 0bada8cc01cff45060b2589716b180f166ef489c (diff) | |
| download | coinosv3-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.js | 4 |
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 () => {}; } } |
