From ed0ee5be205cbe89c31edf0fc65c7c17820a9a91 Mon Sep 17 00:00:00 2001 From: gabrielmer <101006718+gabrielmer@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:58:29 +0300 Subject: [PATCH] chore: improving get_peer_ids_by_protocol by returning the available protocols of connected peers (#3109) --- .../requests/peer_manager_request.nim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/waku_thread/inter_thread_communication/requests/peer_manager_request.nim b/library/waku_thread/inter_thread_communication/requests/peer_manager_request.nim index 5736d2542..5e28738e1 100644 --- a/library/waku_thread/inter_thread_communication/requests/peer_manager_request.nim +++ b/library/waku_thread/inter_thread_communication/requests/peer_manager_request.nim @@ -81,8 +81,11 @@ proc process*( return ok(peerIDs) of GET_PEER_IDS_BY_PROTOCOL: ## returns a comma-separated string of peerIDs that mount the given protocol - let (inPeers, outPeers) = waku.node.peerManager.connectedPeers($self[].protocol) - let allPeerIDs = inPeers & outPeers - return ok(allPeerIDs.join(",")) + let connectedPeers = waku.node.peerManager.wakuPeerStore + .peers($self[].protocol) + .filterIt(it.connectedness == Connected) + .mapIt($it.peerId) + .join(",") + return ok(connectedPeers) return ok("")