emitGossip: gossip to D peers.
This commit is contained in:
parent
cd94989155
commit
9103afa349
12
gossipsub.go
12
gossipsub.go
|
@ -527,14 +527,16 @@ func (gs *GossipSubRouter) emitGossip(topic string, exclude map[peer.ID]struct{}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
gpeers := gs.getPeers(topic, GossipSubD, func(peer.ID) bool { return true })
|
// Send gossip to D peers, skipping over the exclude set.
|
||||||
for _, p := range gpeers {
|
gpeers := gs.getPeers(topic, GossipSubD, func(p peer.ID) bool {
|
||||||
// skip mesh peers
|
|
||||||
_, ok := exclude[p]
|
_, ok := exclude[p]
|
||||||
if !ok {
|
return !ok
|
||||||
|
})
|
||||||
|
|
||||||
|
// Emit the IHAVE gossip to the selected peers.
|
||||||
|
for _, p := range gpeers {
|
||||||
gs.pushGossip(p, &pb.ControlIHave{TopicID: &topic, MessageIDs: mids})
|
gs.pushGossip(p, &pb.ControlIHave{TopicID: &topic, MessageIDs: mids})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gs *GossipSubRouter) flush() {
|
func (gs *GossipSubRouter) flush() {
|
||||||
|
|
Loading…
Reference in New Issue