Use peer ip in peer exchange if no active connection
This commit is contained in:
parent
6dae187e22
commit
46210b2f04
1 changed files with 4 additions and 1 deletions
|
@ -345,7 +345,10 @@ class Peer(object):
|
|||
back[hash] += list(map(unpacker_func, peers))
|
||||
|
||||
for hash in res.get("my", []):
|
||||
back[hash].append((self.connection.ip, self.connection.port))
|
||||
if self.connection:
|
||||
back[hash].append((self.connection.ip, self.connection.port))
|
||||
else:
|
||||
back[hash].append((self.ip, self.port))
|
||||
|
||||
return back
|
||||
|
||||
|
|
Loading…
Reference in a new issue