relay: improve variable names in handleReq

This commit is contained in:
Alex Gleason 2023-08-25 13:42:58 -05:00
parent c18d7b952f
commit d1117f5513
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 4 additions and 4 deletions

View File

@ -54,16 +54,16 @@ function connectStream(socket: WebSocket) {
}
/** Handle REQ. Start a subscription. */
async function handleReq([_, subId, ...filters]: ClientREQ): Promise<void> {
const prepared = prepareFilters(filters);
async function handleReq([_, subId, ...rest]: ClientREQ): Promise<void> {
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]);
}
}