From d1117f55135017bb3619fee6f3d7019fb71d4d58 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 25 Aug 2023 13:42:58 -0500 Subject: [PATCH] relay: improve variable names in handleReq --- src/controllers/nostr/relay.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/nostr/relay.ts b/src/controllers/nostr/relay.ts index 92607f8..3e03f49 100644 --- a/src/controllers/nostr/relay.ts +++ b/src/controllers/nostr/relay.ts @@ -54,16 +54,16 @@ function connectStream(socket: WebSocket) { } /** Handle REQ. Start a subscription. */ - async function handleReq([_, subId, ...filters]: ClientREQ): Promise { - const prepared = prepareFilters(filters); + async function handleReq([_, subId, ...rest]: ClientREQ): Promise { + const filters = prepareFilters(rest); - for (const event of await eventsDB.getFilters(prepared)) { + for (const event of await eventsDB.getFilters(filters)) { send(['EVENT', subId, event]); } send(['EOSE', subId]); - for await (const event of Sub.sub(socket, subId, prepared)) { + for await (const event of Sub.sub(socket, subId, filters)) { send(['EVENT', subId, event]); } }