Accept only 30 peers on pex
This commit is contained in:
parent
122ef02605
commit
07a6bd523c
1 changed files with 2 additions and 2 deletions
|
@ -280,9 +280,9 @@ class Peer(object):
|
||||||
if not res or "error" in res:
|
if not res or "error" in res:
|
||||||
return False
|
return False
|
||||||
# Unpack IP4
|
# Unpack IP4
|
||||||
back = {key: map(helper.unpackAddress, val) for key, val in res["peers"].iteritems()}
|
back = {key: map(helper.unpackAddress, val) for key, val in res["peers"].items()[0:30]}
|
||||||
# Unpack onion
|
# Unpack onion
|
||||||
for hash, onion_peers in res.get("peers_onion", {}).iteritems():
|
for hash, onion_peers in res.get("peers_onion", {}).items()[0:30]:
|
||||||
if not hash in back:
|
if not hash in back:
|
||||||
back[hash] = []
|
back[hash] = []
|
||||||
back[hash] += map(helper.unpackOnionAddress, onion_peers)
|
back[hash] += map(helper.unpackOnionAddress, onion_peers)
|
||||||
|
|
Loading…
Reference in a new issue