'Tries to fetch events we are missing. This is called when we receive
an event without having received all of its ancestors.
Args:
destination (str)
room_id (str)
earliest_events_ids (list): List of event ids. Effectively the
events we expected to receive, but haven\'t. `get_missing_events`
should only return events that didn\'t happen before these.
latest_events (list): List of events we have received that we don\'t
have all previous events for.
limit (int): Maximum number of events to return.
min_depth (int): Minimum depth of events tor return.
timeout (int): Max time to wait in ms'

@defer.inlineCallbacks
def get_missing_events(self, destination, room_id, earliest_events_ids, latest_events, limit, min_depth, timeout):

    try:
        content = (yield self.transport_layer.get_missing_events(destination=destination, room_id=room_id, earliest_events=earliest_events_ids, latest_events=[e.event_id for e in latest_events], limit=limit, min_depth=min_depth, timeout=timeout))
        events = [self.event_from_pdu_json(e) for e in content.get('events', [])]
        signed_events = (yield self._check_sigs_and_hash_and_fetch(destination, events, outlier=False))
    except HttpResponseException as e:
        if (not (e.code == 400)):
            raise
        signed_events = []
    defer.returnValue(signed_events)
