diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-10-16 23:25:12 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-10-16 23:25:12 +0100 |
commit | bb04447c44036ebf3ae5dde7a4cc7a7909d50ef6 (patch) | |
tree | 7d49733df88b2e500853d8335891adfa498a3d66 /synapse/federation/units.py | |
parent | Sign outgoing PDUs. (diff) | |
download | synapse-bb04447c44036ebf3ae5dde7a4cc7a7909d50ef6.tar.xz |
Include hashes of previous pdus when referencing them
Diffstat (limited to 'synapse/federation/units.py')
-rw-r--r-- | synapse/federation/units.py | 10 |
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: |