mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-02 03:06:41 +00:00
fix delete
This commit is contained in:
parent
85df9e8a4b
commit
182a0e8de0
10
simulator.py
10
simulator.py
@ -35,7 +35,7 @@ class Node:
|
|||||||
while numshares and permuted:
|
while numshares and permuted:
|
||||||
pid,node = permuted.pop(0)
|
pid,node = permuted.pop(0)
|
||||||
tried += 1
|
tried += 1
|
||||||
last_givento = node
|
last_givento = pid
|
||||||
if node.accept_share(fileid, sharesize):
|
if node.accept_share(fileid, sharesize):
|
||||||
givento.append((pid,node))
|
givento.append((pid,node))
|
||||||
numshares -= 1
|
numshares -= 1
|
||||||
@ -132,11 +132,11 @@ class Queen:
|
|||||||
return permuted
|
return permuted
|
||||||
|
|
||||||
def delete(self, fileid):
|
def delete(self, fileid):
|
||||||
peers = self.permute_peers(fileid)
|
permuted = self.permute_peers(fileid)
|
||||||
size, tried, last_givento = self.living_files[fileid]
|
size, tried, last_givento = self.living_files[fileid]
|
||||||
peer = ""
|
pid = ""
|
||||||
while tried and peer < last_givento:
|
while tried and pid < last_givento:
|
||||||
peer,node = permuted.pop(0)
|
pid,node = permuted.pop(0)
|
||||||
had_it = node.delete_share(fileid)
|
had_it = node.delete_share(fileid)
|
||||||
if had_it:
|
if had_it:
|
||||||
tried -= 1
|
tried -= 1
|
||||||
|
Loading…
Reference in New Issue
Block a user