From a8c213364725ee762e7b021934a804923043a1d1 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Thu, 17 Apr 2025 10:48:56 +0200 Subject: [PATCH] adding some more temporary logs in peer_manager --- waku/node/peer_manager/peer_manager.nim | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/waku/node/peer_manager/peer_manager.nim b/waku/node/peer_manager/peer_manager.nim index 39baeea3e..b3d8b3b08 100644 --- a/waku/node/peer_manager/peer_manager.nim +++ b/waku/node/peer_manager/peer_manager.nim @@ -506,8 +506,16 @@ proc getStreamByPeerIdAndProtocol*( ## Notice that the "Connection" type represents a stream within a transport connection ## (we will need to adapt this term.) + let remotePeerInfo = pm.getPeer(peerId) + debug "AAAAAAA getStreamByPeerIdAndProtocol", + peerId = peerId, + protocol = protocol, + remoteAgent = remotePeerInfo.agent, + remotePeerInfo = remotePeerInfo + let peerIdsMuxers: Table[PeerId, seq[Muxer]] = pm.switch.connManager.getConnections() if not peerIdsMuxers.contains(peerId): + debug "AAAAAAA peerId not found in connManager", peerId = peerId return err("peerId not found in connManager: " & $peerId) let muxers = peerIdsMuxers[peerId] @@ -525,14 +533,19 @@ proc getStreamByPeerIdAndProtocol*( ) if streamsOfInterest.len > 0: + debug "AAAAAAA open stream found, using it", peerId = peerId, protocol = protocol ## In theory there should be one stream per protocol. Then we just pick up the 1st return ok(streamsOfInterest[0]) ## There isn't still a stream. Let's dial to create one let streamRes = await pm.dialPeer(peerId, protocol) if streamRes.isNone(): + debug "AAAAAAA dial failed, no connection to peer", + peerId = peerId, protocol = protocol return err("getStreamByPeerIdProto no connection to peer: " & $peerId) + debug "AAAAAAA dialed stream", peerId = peerId, protocol = protocol + return ok(streamRes.get()) proc connectToRelayPeers*(pm: PeerManager) {.async.} =