From 31c9b219f460018f9f97634022d4dd897d63f372 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 18 May 2020 19:22:57 +0300 Subject: [PATCH] use the proto we already have in AddPeer to determine whether the connection houses the stream --- gossipsub.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gossipsub.go b/gossipsub.go index f1ce13a..c7666f9 100644 --- a/gossipsub.go +++ b/gossipsub.go @@ -361,12 +361,7 @@ loop: if c.Stat().Direction == network.DirOutbound { // only count the connection if it has a pubsub stream for _, s := range c.GetStreams() { - switch s.Protocol() { - case FloodSubID: - fallthrough - case GossipSubID_v10: - fallthrough - case GossipSubID_v11: + if s.Protocol() == proto { outbound = true break loop }