From 7f0bc6432569133b1b09a6a772a1f2b0ebfc8bf2 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 7 Jan 2012 14:12:26 -0800 Subject: [PATCH] Retrieve.decode(): simplify setup of DeferredList-like argument make it more obviously match the expectations of _decode_blocks() and _maybe_decode_and_decrypt_segment() --- src/allmydata/mutable/retrieve.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/allmydata/mutable/retrieve.py b/src/allmydata/mutable/retrieve.py index 0845d290..029818dc 100644 --- a/src/allmydata/mutable/retrieve.py +++ b/src/allmydata/mutable/retrieve.py @@ -323,11 +323,10 @@ class Retrieve: self._block_hash_trees = None self._setup_encoding_parameters() - # This is the form expected by decode. - blocks_and_salts = blocks_and_salts.items() - blocks_and_salts = [(True, [d]) for d in blocks_and_salts] - - d = self._decode_blocks(blocks_and_salts, segnum) + # _decode_blocks() expects the output of a DeferredList that contains + # the outputs of _validate_block() (each of which is a dict mapping + # shnum to (block,salt) bytestrings). + d = self._decode_blocks([(True, blocks_and_salts)], segnum) d.addCallback(self._decrypt_segment) return d -- 2.45.2