skip on invalid received hash ids
This commit is contained in:
parent
fd451ae766
commit
814fa881d0
1 changed files with 1 additions and 1 deletions
|
@ -288,7 +288,7 @@ class Peer(object):
|
||||||
# Return: {hash1: ["ip:port", "ip:port",...],...}
|
# Return: {hash1: ["ip:port", "ip:port",...],...}
|
||||||
def findHashIds(self, hash_ids):
|
def findHashIds(self, hash_ids):
|
||||||
res = self.request("findHashIds", {"site": self.site.address, "hash_ids": hash_ids})
|
res = self.request("findHashIds", {"site": self.site.address, "hash_ids": hash_ids})
|
||||||
if not res or "error" in res:
|
if not res or "error" in res or type(res) is not dict:
|
||||||
return False
|
return False
|
||||||
# Unpack IP4
|
# Unpack IP4
|
||||||
back = {key: map(helper.unpackAddress, val) for key, val in res["peers"].items()[0:30]}
|
back = {key: map(helper.unpackAddress, val) for key, val in res["peers"].items()[0:30]}
|
||||||
|
|
Loading…
Reference in a new issue