summary refs log tree commit diff
path: root/synapse/federation/units.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-16 23:25:12 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-16 23:25:12 +0100
commitbb04447c44036ebf3ae5dde7a4cc7a7909d50ef6 (patch)
tree7d49733df88b2e500853d8335891adfa498a3d66 /synapse/federation/units.py
parentSign outgoing PDUs. (diff)
downloadsynapse-bb04447c44036ebf3ae5dde7a4cc7a7909d50ef6.tar.xz
Include hashes of previous pdus when referencing them
Diffstat (limited to 'synapse/federation/units.py')
-rw-r--r--synapse/federation/units.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/federation/units.py b/synapse/federation/units.py
index 3518efb215..6a43007837 100644
--- a/synapse/federation/units.py
+++ b/synapse/federation/units.py
@@ -141,8 +141,16 @@ class Pdu(JsonEncodedObject):
                 for kid, sig in pdu_tuple.signatures.items()
             }
 
+            prev_pdus = []
+            for prev_pdu in pdu_tuple.prev_pdu_list:
+                prev_hashes = pdu_tuple.edge_hashes.get(prev_pdu, {})
+                prev_hashes = {
+                    alg: encode_base64(hsh) for alg, hsh in prev_hashes.items()
+                }
+                prev_pdus.append((prev_pdu[0], prev_pdu[1], prev_hashes))
+
             return Pdu(
-                prev_pdus=pdu_tuple.prev_pdu_list,
+                prev_pdus=prev_pdus,
                 **args
             )
         else: