remove nodes that went ignored during iteration

This commit is contained in:
Victor Shyba 2018-07-16 17:22:46 -03:00
parent 2c13c04f86
commit 562d23df11

View file

@ -160,6 +160,9 @@ class _IterativeFind(object):
already_contacted_addresses = {(c.address, c.port) for c in self.already_contacted}
to_remove = []
for contact in self.shortlist:
if self.node.contact_manager.is_ignored((contact.address, contact.port)):
to_remove.append(contact) # a contact became bad during iteration
continue
if (contact.address, contact.port) not in already_contacted_addresses:
self.already_contacted.append(contact)
to_remove.append(contact)