add limit to the number of peers to connect to from px
This commit is contained in:
parent
f20f93004b
commit
17fd85f02c
|
@ -383,7 +383,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…
Reference in New Issue