mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-03 21:33:07 +00:00
add limit to the number of peers to connect to from px
This commit is contained in:
parent
a4c5325665
commit
e4667b6073
@ -288,7 +288,12 @@ func (gs *GossipSubRouter) addBackoff(p peer.ID, topic string) {
|
||||
}
|
||||
|
||||
func (gs *GossipSubRouter) pxConnect(peers []*pb.PeerInfo) {
|
||||
if len(peers) > GossipSubPrunePeers {
|
||||
peers = peers[:GossipSubPrunePeers]
|
||||
}
|
||||
|
||||
toconnect := make([]connectInfo, 0, len(peers))
|
||||
|
||||
for _, pi := range peers {
|
||||
p := peer.ID(pi.PeerID)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user