use the proto we already have in AddPeer to determine whether the connection houses the stream

This commit is contained in:
vyzo 2020-05-18 19:22:57 +03:00
parent 4207beae0d
commit 31c9b219f4

View File

@ -361,12 +361,7 @@ loop:
if c.Stat().Direction == network.DirOutbound { if c.Stat().Direction == network.DirOutbound {
// only count the connection if it has a pubsub stream // only count the connection if it has a pubsub stream
for _, s := range c.GetStreams() { for _, s := range c.GetStreams() {
switch s.Protocol() { if s.Protocol() == proto {
case FloodSubID:
fallthrough
case GossipSubID_v10:
fallthrough
case GossipSubID_v11:
outbound = true outbound = true
break loop break loop
} }