From 5092e25837cac1e46a62983b0fc0880fd39a163a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 29 Apr 2024 09:26:39 -0300 Subject: [PATCH] use a little less relays. --- nostr.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nostr.go b/nostr.go index 5d57608..f1891f1 100644 --- a/nostr.go +++ b/nostr.go @@ -36,13 +36,12 @@ var ( relayConfig = RelayConfig{ Everything: []string{ "wss://nostr-pub.wellorder.net", - "wss://saltivka.org", "wss://relay.damus.io", "wss://relay.nostr.bg", "wss://nostr.wine", "wss://nos.lol", "wss://nostr.mom", - "wss://atlas.nostr.land", + "wss://nostr.land", "wss://relay.snort.social", "wss://offchain.pub", "wss://relay.primal.net", @@ -154,14 +153,11 @@ func getEvent(ctx context.Context, code string, relayHints []string) (*nostr.Eve if author != "" { // fetch relays for author authorRelays := relaysForPubkey(ctx, author, relays...) - if len(authorRelays) > 5 { - authorRelays = authorRelays[:5] + if len(authorRelays) > 3 { + authorRelays = authorRelays[:3] } relays = append(relays, authorRelays...) } - for len(relays) < 5 { - relays = append(relays, getRandomRelay()) - } relays = unique(relays) ctx, cancel := context.WithTimeout(ctx, time.Second*8)