validate events on receive

This commit is contained in:
2023-10-11 18:28:28 +01:00
parent 022296fa18
commit 88ac4063cd
3 changed files with 39 additions and 13 deletions

View File

@ -18,6 +18,7 @@ import {
RelayMetricCache,
UsersRelays,
SnortSystemDb,
EventExt,
} from ".";
import { EventsCache } from "./cache/events";
import { RelayCache } from "./gossip-model";
@ -178,6 +179,8 @@ export class NostrSystem extends ExternalStore<SystemSnapshot> implements System
}
#onEvent(sub: string, ev: TaggedNostrEvent) {
if (!EventExt.isValid(ev)) return;
for (const [, v] of this.Queries) {
v.handleEvent(sub, ev);
}