mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
Filter out some relays from the archive
This commit is contained in:
4
nostr.go
4
nostr.go
@@ -41,6 +41,10 @@ var (
|
||||
"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322", // hodlbod
|
||||
"ee11a5dff40c19a555f41fe42b48f00e618c91225622ae37b6c2bb67b76c4e49", // Michael Dilger
|
||||
}
|
||||
|
||||
excludedRelays = []string{
|
||||
"wss://filter.nostr.wine", // paid
|
||||
}
|
||||
)
|
||||
|
||||
func getRelay() string {
|
||||
|
||||
9
utils.go
9
utils.go
@@ -380,6 +380,15 @@ 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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user