mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-04 23:13:09 +00:00
fix: use total peers for pubsubTopic as out peers target (#1170)
This commit is contained in:
parent
a9be17fd48
commit
76d8fd687d
@ -313,8 +313,10 @@ func (pm *PeerManager) ensureMinRelayConnsPerTopic() {
|
||||
// peers. This will ensure that the peers returned by this function
|
||||
// match those peers that are currently connected
|
||||
|
||||
curPeerLen := pm.checkAndUpdateTopicHealth(topicInst)
|
||||
if curPeerLen < pm.OutPeersTarget {
|
||||
meshPeerLen := pm.checkAndUpdateTopicHealth(topicInst)
|
||||
topicPeers := pm.host.Peerstore().(wps.WakuPeerstore).PeersByPubSubTopic(topicStr)
|
||||
curPeerLen := topicPeers.Len()
|
||||
if meshPeerLen < waku_proto.GossipSubDMin || curPeerLen < pm.OutPeersTarget {
|
||||
pm.logger.Debug("subscribed topic has not reached target peers, initiating more connections to maintain healthy mesh",
|
||||
zap.String("pubSubTopic", topicStr), zap.Int("connectedPeerCount", curPeerLen),
|
||||
zap.Int("targetPeers", pm.OutPeersTarget))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user