From f27d2c1957928f2798b3b27fbcf58330c17c7dd7 Mon Sep 17 00:00:00 2001 From: Barry Deen Date: Mon, 23 Sep 2024 12:21:27 -0400 Subject: [PATCH] discard bad notes sent by relays --- import.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/import.go b/import.go index 513463e..d8d4c38 100644 --- a/import.go +++ b/import.go @@ -85,8 +85,12 @@ func importTaggedNotes() { }} for ev := range pool.SubManyEose(ctx, config.ImportSeedRelays, filters) { - wdb.Publish(ctx, *ev.Event) - taggedImportedNotes++ + for _, tag := range ev.Event.Tags.GetAll([]string{"p"}) { + if tag[1] == nPubToPubkey(config.OwnerNpub) { + wdb.Publish(ctx, *ev.Event) + taggedImportedNotes++ + } + } } log.Println("📦 imported", taggedImportedNotes, "tagged notes") time.Sleep(5 * time.Second)