Apply suggestions from code review

Co-Authored-By: NIC Lin <twedusuck@gmail.com>
This commit is contained in:
Kevin Mai-Husan Chia 2019-08-20 16:00:27 +08:00 committed by mhchia
parent 0b62321265
commit 2a1367b011
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A

View File

@ -60,7 +60,7 @@ class InsecureTransport(BaseSecureTransport):
await session.run_handshake()
# TODO: Check if `remote_public_key is not None`. If so, check if `session.remote_peer`
received_peer_id = session.get_remote_peer()
if session.get_remote_peer() != peer_id:
if received_peer_id != peer_id:
raise UpgradeFailure(
"remote peer sent unexpected peer ID. "
f"expected={peer_id} received={received_peer_id}"