fix delete
authorBrian Warner <warner@lothar.com>
Wed, 29 Nov 2006 00:10:49 +0000 (17:10 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 29 Nov 2006 00:10:49 +0000 (17:10 -0700)
simulator.py

index 31335cdd1b361ef69e651e4a02bd1be64d7bdaed..a93d44d0fd6851a335cb64e5ed1e0ed8a07b860d 100644 (file)
@@ -35,7 +35,7 @@ class Node:
         while numshares and permuted:
             pid,node = permuted.pop(0)
             tried += 1
-            last_givento = node
+            last_givento = pid
             if node.accept_share(fileid, sharesize):
                 givento.append((pid,node))
                 numshares -= 1
@@ -132,11 +132,11 @@ class Queen:
         return permuted
 
     def delete(self, fileid):
-        peers = self.permute_peers(fileid)
+        permuted = self.permute_peers(fileid)
         size, tried, last_givento = self.living_files[fileid]
-        peer = ""
-        while tried and peer < last_givento:
-            peer,node = permuted.pop(0)
+        pid = ""
+        while tried and pid < last_givento:
+            pid,node = permuted.pop(0)
             had_it = node.delete_share(fileid)
             if had_it:
                 tried -= 1