summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-04-28 11:55:25 +0100
committerErik Johnston <erik@matrix.org>2017-04-28 11:55:25 +0100
commit9b147cd73049c6222fa6c3b45dfb2a360de93cc4 (patch)
tree61a9e696499c21a8a0400b959c2ed4a8a724efd8 /synapse/handlers/federation.py
parentDon't fetch state for missing events that we fetched (diff)
downloadsynapse-9b147cd73049c6222fa6c3b45dfb2a360de93cc4.tar.xz
Remove unncessary call in _get_missing_events_for_pdu
Diffstat (limited to '')
-rw-r--r--synapse/handlers/federation.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 33321699a6..43d1ec859d 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -177,6 +177,17 @@ class FederationHandler(BaseHandler):
                         have_seen = yield self.store.have_events(
                             [ev for ev, _ in pdu.prev_events]
                         )
+
+                        seen = set(have_seen.keys())
+                        if prevs - seen:
+                            logger.info(
+                                "Still missing %d prev events for %s: %r...",
+                                len(prevs - seen), pdu.event_id, list(prevs - seen)[:5]
+                            )
+                        else:
+                            logger.info(
+                                "Found all missing prev events for %s", pdu.event_id
+                            )
                 elif prevs - seen:
                     logger.info(
                         "Not fetching %d missing events for room %r,event %s: %r...",
@@ -294,19 +305,6 @@ class FederationHandler(BaseHandler):
                 get_missing=False
             )
 
-        have_seen = yield self.store.have_events(
-            [ev for ev, _ in pdu.prev_events]
-        )
-        seen = set(have_seen.keys())
-        if prevs - seen:
-            logger.info(
-                "Still missing %d prev events for %s: %r...",
-                len(prevs - seen), pdu.event_id, list(prevs - seen)[:5]
-            )
-        else:
-            logger.info("Found all missing prev events for %s", pdu.event_id)
-        defer.returnValue(have_seen)
-
     @log_function
     @defer.inlineCallbacks
     def _process_received_pdu(self, origin, pdu, state, auth_chain):