mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-02-01 03:03:13 +00:00
reduce gossip amplification; don't send to mesh peers
This commit is contained in:
parent
0e288dc741
commit
c5fe290389
@ -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})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user