def __init__(self, privkey, hello_packet, remote_pubkey=None): self.is_initiator = bool(remote_pubkey) self.hello_packet = hello_packet self.message_queue = gevent.queue.Queue() # wire msg egress queue self.packet_queue = gevent.queue.Queue() # packet ingress queue ecc = ECCx(raw_privkey=privkey) self.rlpx_session = RLPxSession( ecc, is_initiator=bool(remote_pubkey)) self._remote_pubkey = remote_pubkey multiplexer.Multiplexer.__init__(self, frame_cipher=self.rlpx_session) if self.is_initiator: self._send_init_msg()