diff --git a/package.json b/package.json index 91a5321..90e19db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nostr-tools", - "version": "0.23.1", + "version": "0.23.3", "description": "Tools for making a Nostr client.", "repository": { "type": "git", diff --git a/pool.js b/pool.js index 12e6735..ada6e32 100644 --- a/pool.js +++ b/pool.js @@ -26,10 +26,9 @@ export function relayPool() { const activeSubscriptions = {} - const sub = ( - {cb, filter, beforeSend}, - id = Math.random().toString().slice(2) - ) => { + const sub = ({cb, filter, beforeSend}, id) => { + if (!id) id = Math.random().toString().slice(2) + const subControllers = Object.fromEntries( Object.values(relays) .filter(({policy}) => policy.read)