chore: use available peers rather than connected peers, since in case of lightMode we don't connect to all boot nodes

This commit is contained in:
Prem Chaitanya Prathi 2024-02-21 10:40:38 +05:30 committed by frank
parent 500755110a
commit 92685e5a7b
1 changed files with 2 additions and 2 deletions

View File

@ -566,9 +566,9 @@ func (w *Waku) runPeerExchangeLoop() {
case <-ticker.C:
w.logger.Info("Running peer exchange loop")
connectedPeers := w.node.Host().Network().Peers()
availablePeers := w.node.Host().Peerstore().Peers()
peersWithRelay := 0
for _, p := range connectedPeers {
for _, p := range availablePeers {
supportedProtocols, err := w.node.Host().Peerstore().SupportsProtocols(p, relay.WakuRelayID_v200)
if err != nil {
continue