check for tag length before adding

This commit is contained in:
Barry Deen 2024-09-12 15:41:00 -04:00
parent ed76ae568e
commit 2bd132cf73

View File

@ -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"}) {