Only advertise nodes we are fully connected to

This commit is contained in:
TheKysek 2016-07-05 09:02:26 +02:00
parent a9155eb08f
commit 6aff15a59d

View File

@ -102,7 +102,7 @@ class Connection(threading.Thread):
def _send_big_inv(self): def _send_big_inv(self):
with shared.objects_lock: with shared.objects_lock:
self.send_queue.put(message.Inv({vector for vector in shared.objects.keys() if shared.objects[vector].expires_time > time.time()})) self.send_queue.put(message.Inv({vector for vector in shared.objects.keys() if shared.objects[vector].expires_time > time.time()}))
addr = {structure.NetAddr(1, c.host, c.port) for c in shared.connections.copy() if not c.server} addr = {structure.NetAddr(1, c.host, c.port) for c in shared.connections.copy() if not c.server and c.status == 'verack_received'}
if len(addr) != 0: if len(addr) != 0:
self.send_queue.put(message.Addr(addr)) self.send_queue.put(message.Addr(addr))
self.sent_big_inv_message = True self.sent_big_inv_message = True