reduce gossip amplification; don't send to mesh peers

This commit is contained in:
vyzo 2018-02-20 15:10:16 +02:00 committed by Steven Allen
parent 0e288dc741
commit c5fe290389

View File

@ -373,7 +373,11 @@ func (gs *GossipSubRouter) heartbeat() {
gpeers := gs.getPeers(topic, func(peer.ID) bool { return true })
for _, p := range gpeers[:GossipSubD] {
gs.pushGossip(p, &pb.ControlIHave{TopicID: &topic, MessageIDs: mids})
// skip mesh peers
_, ok := peers[p]
if !ok {
gs.pushGossip(p, &pb.ControlIHave{TopicID: &topic, MessageIDs: mids})
}
}
}