Remove hash by id from hashfield
This commit is contained in:
parent
d39d6a2bd4
commit
91513f15ae
1 changed files with 8 additions and 0 deletions
|
@ -44,6 +44,14 @@ class PeerHashfield(object):
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def removeHashId(self, hash_id):
|
||||||
|
if hash_id in self.storage:
|
||||||
|
self.storage.remove(hash_id)
|
||||||
|
self.time_changed = time.time()
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def getHashId(self, hash):
|
def getHashId(self, hash):
|
||||||
return int(hash[0:4], 16)
|
return int(hash[0:4], 16)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue