From e41aa578b2bb95ffb5b450ea8c4f232417217c1e Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Wed, 19 Jun 2024 12:18:41 +0200 Subject: [PATCH] fix: adding peer exchange peers to the peerStore --- waku/factory/node_factory.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/waku/factory/node_factory.nim b/waku/factory/node_factory.nim index f3cbb7fe74..0c0e2cab80 100644 --- a/waku/factory/node_factory.nim +++ b/waku/factory/node_factory.nim @@ -135,11 +135,12 @@ proc setupProtocols( # only peers with populated records .mapIt(toRemotePeerInfo(it.record.get())) - debug "connecting to exchanged peers", + debug "adding exchanged peers", src = peer, topic = topic, numPeers = exchangedPeers.len - # asyncSpawn, as we don't want to block here - asyncSpawn node.connectToNodes(exchangedPeers, "peer exchange") + for peer in exchangedPeers: + # Peers added are filtered by the peer manager + node.peerManager.addPeer(peer, PeerOrigin.PeerExchange) peerExchangeHandler = some(handlePeerExchange)