<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connectionMade(self):
 """Callback handler from twisted when establishing a new connection."""

        self.endpoint = self.transport.getPeer()
        # get the reference to the Address object in NodeLeader so we can manipulate it properly.
        tmp_addr = Address(f"{self.endpoint.host}:{self.endpoint.port}")
        try:
            known_idx = self.leader.KNOWN_ADDRS.index(tmp_addr)
            self.address = self.leader.KNOWN_ADDRS[known_idx]
        except ValueError:
            # Not found.
            self.leader.AddKnownAddress(tmp_addr)
            self.address = tmp_addr

        self.address.address = "%s:%s" % (self.endpoint.host, self.endpoint.port)
        self.host = self.endpoint.host
        self.port = int(self.endpoint.port)
        self.leader.AddConnectedPeer(self)
        self.leader.RemoveFromQueue(self.address)
        self.leader.peers_connecting -= 1
        logger.debug(f"{self.address} connection established")
        if self.incoming_client:
            # start protocol
            self.SendVersion()