Object sending efficiency improvement

This commit is contained in:
TheKysek 2017-03-20 21:10:29 +01:00
parent d4f5d370d4
commit dbd1515ae8

View File

@ -263,6 +263,8 @@ class Connection(threading.Thread):
to_get = inv.vectors.copy()
to_get.difference_update(shared.objects.keys())
self.vectors_to_get.update(to_get)
# Do not send objects they already have.
self.vectors_to_send.difference_update(inv.vectors)
elif m.command == b'object':
obj = structure.Object.from_message(m)
logging.debug('{}:{} -> {}'.format(self.host, self.port, obj))