From 01dc49164f70b9c6dcb5ec76391ca9de9b99f518 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Fri, 25 Oct 2019 20:18:40 +0900 Subject: [PATCH] fix bug found via typechecker --- libp2p/identity/identify/protocol.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libp2p/identity/identify/protocol.py b/libp2p/identity/identify/protocol.py index a71d6243..938e04bd 100644 --- a/libp2p/identity/identify/protocol.py +++ b/libp2p/identity/identify/protocol.py @@ -24,7 +24,8 @@ def identify_handler_for( public_key: PublicKey, laddrs: Sequence[Multiaddr], protocols: Sequence[TProtocol] ) -> StreamHandlerFn: async def handle_identify(stream: INetStream) -> None: - logger.debug("received a request for % from %", ID, stream.mplex_conn.peer_id) + peer_id = stream.muxed_conn.peer_id + logger.debug("received a request for % from %", ID, peer_id) protobuf = Identify( protocol_version=PROTOCOL_VERSION, @@ -39,8 +40,6 @@ def identify_handler_for( await stream.write(response) await stream.close() - logger.debug( - "succesfully handled request for % from %", ID, stream.mplex_conn.peer_id - ) + logger.debug("succesfully handled request for % from %", ID, peer_id) return handle_identify