Skip to content

Commit

Permalink
Merge pull request #42 from bitvora/dev-fixFJMistakes
Browse files Browse the repository at this point in the history
putting back goroutines like i had them before fj told me to remove i…
  • Loading branch information
barrydeen authored Sep 13, 2024
2 parents 11ab126 + 51d8a6e commit 1db8134
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,18 +356,18 @@ func archiveTrustedNotes(ctx context.Context, relay *khatru.Relay) {
log.Println("📦 archiving trusted notes...")

for ev := range pool.SubMany(timeout, seedRelays, filters) {
if trustNetworkMap[ev.PubKey] {
if len(ev.Tags) > 3000 {
continue
}

wdb.Publish(ctx, *ev.Event)
relay.BroadcastEvent(ev.Event)
trustedNotes++
} else {
untrustedNotes++
}
go archiveEvent(relay, *ev.Event)
}

log.Println("📦 archived", trustedNotes, "trusted notes and discarded ", untrustedNotes, "untrusted notes")
}

func archiveEvent(relay *khatru.Relay, ev nostr.Event) {
if trustNetworkMap[ev.PubKey] {
wdb.Publish(context.Background(), ev)
relay.BroadcastEvent(&ev)
trustedNotes++
} else {
untrustedNotes++
}
}

0 comments on commit 1db8134

Please sign in to comment.