Rename SecurityMultistream initiator flag

This commit is contained in:
Dominik Muhs 2019-10-24 19:17:00 +02:00
parent ee0b4daf1c
commit 18783b82a2

View File

@ -76,18 +76,18 @@ class SecurityMultistream(ABC):
return secure_conn return secure_conn
async def select_transport( async def select_transport(
self, conn: IRawConnection, initiator: bool self, conn: IRawConnection, is_initiator: bool
) -> ISecureTransport: ) -> ISecureTransport:
""" """
Select a transport that both us and the node on the Select a transport that both us and the node on the
other end of conn support and agree on other end of conn support and agree on
:param conn: conn to choose a transport over :param conn: conn to choose a transport over
:param initiator: true if we are the initiator, false otherwise :param is_initiator: true if we are the initiator, false otherwise
:return: selected secure transport :return: selected secure transport
""" """
protocol: TProtocol protocol: TProtocol
communicator = MultiselectCommunicator(conn) communicator = MultiselectCommunicator(conn)
if initiator: if is_initiator:
# Select protocol if initiator # Select protocol if initiator
protocol = await self.multiselect_client.select_one_of( protocol = await self.multiselect_client.select_one_of(
list(self.transports.keys()), communicator list(self.transports.keys()), communicator