Filter out some relays from the archive

This commit is contained in:
Daniele Tonon
2023-07-27 22:49:44 +02:00
parent a20b985cc8
commit dcf8e3a451
2 changed files with 14 additions and 1 deletions

View File

@@ -41,6 +41,10 @@ var (
"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322", // hodlbod
"ee11a5dff40c19a555f41fe42b48f00e618c91225622ae37b6c2bb67b76c4e49", // Michael Dilger
}
excludedRelays = []string{
"wss://filter.nostr.wine", // paid
}
)
func getRelay() string {

View File

@@ -380,7 +380,16 @@ func loadRelaysArchive(ctx context.Context) {
relaysArchive = unique(relaysArchive)
for _, relay := range relaysArchive {
for _, excluded := range excludedRelays {
if strings.Contains(relay, excluded) {
fmt.Printf("Skypping relay %s\n", relay)
continue
}
}
if strings.Contains(relay, "/npub1") {
continue // Skip relays with personalyzed query like filter.nostr.wine
}
fmt.Printf("Adding relay %s\n", relay)
cache.SetWithTTL("ra:"+relay, nil, time.Hour*24*7)
}
}
}