summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-04-28 12:46:53 +0100
committerErik Johnston <erik@matrix.org>2017-04-28 12:46:53 +0100
commit2347efc065912a0dca6fd0611012b853d62e6629 (patch)
tree93c4ddf68d9ce706dc13012caca0d45a9a4f122e /synapse/handlers
parentRemove unncessary call in _get_missing_events_for_pdu (diff)
downloadsynapse-2347efc065912a0dca6fd0611012b853d62e6629.tar.xz
Fixup
Diffstat (limited to '')
-rw-r--r--synapse/handlers/federation.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 43d1ec859d..be2ea0cd56 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -174,11 +174,9 @@ class FederationHandler(BaseHandler):
 
                         # Update the set of things we've seen after trying to
                         # fetch the missing stuff
-                        have_seen = yield self.store.have_events(
-                            [ev for ev, _ in pdu.prev_events]
-                        )
+                        have_seen = yield self.store.have_events(prevs)
 
-                        seen = set(have_seen.keys())
+                        seen = set(have_seen.iterkeys())
                         if prevs - seen:
                             logger.info(
                                 "Still missing %d prev events for %s: %r...",
@@ -231,19 +229,15 @@ class FederationHandler(BaseHandler):
         Args:
             origin (str): Origin of the pdu. Will be called to get the missing events
             pdu: received pdu
-            prevs (str[]): List of event ids which we are missing
+            prevs (set(str)): List of event ids which we are missing
             min_depth (int): Minimum depth of events to return.
-
-        Returns:
-            Deferred<dict(str, str?)>: updated have_seen dictionary
         """
         # We recalculate seen, since it may have changed.
         have_seen = yield self.store.have_events(prevs)
         seen = set(have_seen.keys())
 
         if not prevs - seen:
-            # nothing left to do
-            defer.returnValue(have_seen)
+            return
 
         latest = yield self.store.get_latest_event_ids_in_room(
             pdu.room_id