From c50c63f954c0fb6cb72ad5e4f53dd0d79d580b86 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 12 Sep 2024 13:10:36 -0500 Subject: [PATCH] pipeline: purifyEvent before passing it to storage --- src/pipeline.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pipeline.ts b/src/pipeline.ts index afc7acdf..85d27964 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -5,6 +5,7 @@ import { LRUCache } from 'lru-cache'; import { z } from 'zod'; import { Conf } from '@/config.ts'; +import { DittoTables } from '@/db/DittoTables.ts'; import { DittoEvent } from '@/interfaces/DittoEvent.ts'; import { pipelineEventsCounter, policyEventsCounter } from '@/metrics.ts'; import { RelayError } from '@/RelayError.ts'; @@ -14,11 +15,11 @@ import { Storages } from '@/storages.ts'; import { eventAge, parseNip05, Time } from '@/utils.ts'; import { policyWorker } from '@/workers/policy.ts'; import { verifyEventWorker } from '@/workers/verify.ts'; +import { getAmount } from '@/utils/bolt11.ts'; import { nip05Cache } from '@/utils/nip05.ts'; +import { purifyEvent } from '@/utils/purify.ts'; import { updateStats } from '@/utils/stats.ts'; import { getTagSet } from '@/utils/tags.ts'; -import { getAmount } from '@/utils/bolt11.ts'; -import { DittoTables } from '@/db/DittoTables.ts'; const debug = Debug('ditto:pipeline'); @@ -55,7 +56,7 @@ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise