exclude non gossip from fanout
This commit is contained in:
parent
8e2c9301a0
commit
b7382eaf25
|
@ -84,7 +84,7 @@ proc replenishFanout(g: GossipSub, topic: string) =
|
|||
if g.fanout[topic].len < GossipSubDLo:
|
||||
debug "replenishing fanout", peers = g.fanout[topic].len
|
||||
for id, peer in g.peers:
|
||||
if peer.topics.find(topic) != -1: # linear search but likely faster then a small hash
|
||||
if peer.proto == GossipSubCodec and peer.topics.find(topic) != -1: # linear search but likely faster then a small hash
|
||||
if not g.fanout[topic].containsOrIncl(id):
|
||||
g.lastFanoutPubSub[topic] = Moment.fromNow(GossipSubFanoutTTL)
|
||||
if g.fanout.getOrDefault(topic).len == GossipSubD:
|
||||
|
|
|
@ -32,7 +32,7 @@ type
|
|||
onSend*: proc(peer: PubSubPeer; msgs: var RPCMsg) {.gcsafe, raises: [Defect].}
|
||||
|
||||
PubSubPeer* = ref object of RootObj
|
||||
proto: string # the protocol that this peer joined from
|
||||
proto*: string # the protocol that this peer joined from
|
||||
sendConn: Connection
|
||||
peerInfo*: PeerInfo
|
||||
handler*: RPCHandler
|
||||
|
|
Loading…
Reference in New Issue