]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Sun Jan 8 22:12:40 GMT 2012 Brian Warner <warner@lothar.com>
authorDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 16:34:03 +0000 (17:34 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 16:34:03 +0000 (17:34 +0100)
  * 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

index cb9c37f85266477231140ad0352ec7f5bbeedd0f..0d062969a527b9627a1ec7c6872a8128ae48c958 100644 (file)
@@ -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