A working plaintext 2.0 without validation

This commit is contained in:
mhchia
2019-08-17 01:38:50 +08:00
parent a0923d202a
commit 22b1a5395d
7 changed files with 48 additions and 27 deletions

View File

@ -75,18 +75,6 @@ class TCP(ITransport):
reader, writer = await asyncio.open_connection(host, int(port))
# TODO: Change this `sending peer id` process to `/plaintext/2.0.0`
# First: send our peer ID so receiver knows it
writer.write(self_id.to_base58().encode())
await writer.drain()
# Await ack for peer id
expected_ack_str = "received peer id"
ack = (await reader.read(len(expected_ack_str))).decode()
if ack != expected_ack_str:
raise Exception("Receiver did not receive peer id")
return RawConnection(host, port, reader, writer, True)
def create_listener(self, handler_function: THandler) -> TCPListener: