From 2bd132cf73a49a04b1aee7855f47d7dd335e1298 Mon Sep 17 00:00:00 2001 From: Barry Deen Date: Thu, 12 Sep 2024 15:41:00 -0400 Subject: [PATCH] check for tag length before adding --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ac4fbdf..ed8b737 100644 --- a/main.go +++ b/main.go @@ -265,7 +265,9 @@ func refreshTrustNetwork(relay *khatru.Relay, ctx context.Context) { for ev := range pool.SubManyEose(timeout, seedRelays, filters) { for _, contact := range ev.Event.Tags.GetAll([]string{"p"}) { - pubkeyFollowerCount[contact[1]]++ // Increment follower count for the pubkey + if len(contact) > 1 { + pubkeyFollowerCount[contact[1]]++ // Increment follower count for the pubkey + } } for _, relay := range ev.Event.Tags.GetAll([]string{"r"}) {