From fa579c5c4645196c41aa64504bd6ed9c5d11a35f Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Thu, 5 Sep 2013 17:34:03 +0100 Subject: [PATCH] Sun Jan 8 22:12:40 GMT 2012 Brian Warner * 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 cb9c37f8..0d062969 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