mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-04 23:13:09 +00:00
fix: return no peers available
This commit is contained in:
parent
99b3ab5b2a
commit
0c4ee98c7d
@ -73,7 +73,10 @@ func (pm *PeerManager) SelectRandom(criteria PeerSelectionCriteria) (peer.IDSlic
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(criteria.PubsubTopics) > 0 && len(filteredPeers) > 0 {
|
||||
if len(filteredPeers) == 0 {
|
||||
return nil, utils.ErrNoPeersAvailable
|
||||
}
|
||||
if len(criteria.PubsubTopics) > 0 {
|
||||
filteredPeers = pm.host.Peerstore().(wps.WakuPeerstore).PeersByPubSubTopics(criteria.PubsubTopics, filteredPeers...)
|
||||
}
|
||||
//Not passing excludePeers as filterPeers are already considering excluded ones.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user