summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/__init__.py5
-rw-r--r--synapse/storage/event_federation.py4
2 files changed, 5 insertions, 4 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 678de0cf50..f89e518690 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -322,9 +322,10 @@ class DataStore(RoomMemberStore, RoomStore,
                     txn, event.event_id, prev_event_id, alg, hash_bytes
                 )
 
+        # TODO
         (ref_alg, ref_hash_bytes) = compute_pdu_event_reference_hash(pdu)
-        self._store_pdu_reference_hash_txn(
-            txn, pdu.pdu_id, pdu.origin, ref_alg, ref_hash_bytes
+        self._store_event_reference_hash_txn(
+            txn, event.event_id, ref_alg, ref_hash_bytes
         )
 
         self._update_min_depth_for_room_txn(txn, event.room_id, event.depth)
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 27ad9aea4d..7688fc550f 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 from ._base import SQLBaseStore
-from twisted.internet import defer
+from syutil.base64util import encode_base64
 
 import logging
 
@@ -36,7 +36,7 @@ class EventFederationStore(SQLBaseStore):
 
         results = []
         for pdu_id, origin, depth in txn.fetchall():
-            hashes = self._get_pdu_reference_hashes_txn(txn, pdu_id, origin)
+            hashes = self._get_prev_event_hashes_txn(txn, pdu_id, origin)
             sha256_bytes = hashes["sha256"]
             prev_hashes = {"sha256": encode_base64(sha256_bytes)}
             results.append((pdu_id, origin, prev_hashes, depth))