From 63c733c3f5c62c697ef16d3c067f8f9a819f912c Mon Sep 17 00:00:00 2001 From: Chih Cheng Liang Date: Mon, 5 Aug 2019 16:58:34 +0800 Subject: [PATCH] PR feedback --- libp2p/transport/tcp/tcp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libp2p/transport/tcp/tcp.py b/libp2p/transport/tcp/tcp.py index 20116f7..02d981b 100644 --- a/libp2p/transport/tcp/tcp.py +++ b/libp2p/transport/tcp/tcp.py @@ -69,9 +69,9 @@ class TCP(ITransport): :return: True if successful """ host = maddr.value_for_protocol("ip4") - port = int(maddr.value_for_protocol("tcp")) + port = maddr.value_for_protocol("tcp") - reader, writer = await asyncio.open_connection(host, port) + reader, writer = await asyncio.open_connection(host, int(port)) # First: send our peer ID so receiver knows it writer.write(self_id.to_base58().encode()) @@ -84,7 +84,7 @@ class TCP(ITransport): if ack != expected_ack_str: raise Exception("Receiver did not receive peer id") - return RawConnection(host, str(port), reader, writer, True) + return RawConnection(host, port, reader, writer, True) def create_listener(self, handler_function: THandler) -> TCPListener: """