WIP: Update request time in vectors_requested to not re-request too often #16

Draft
lee.miller wants to merge 1 commits from lee.miller/MiNode:network into v0.3

View File

@ -431,13 +431,13 @@ class ConnectionBase(threading.Thread):
self.send_queue.put(message.GetData(pack)) self.send_queue.put(message.GetData(pack))
self.vectors_requested.update({ self.vectors_requested.update({
vector: time.time() for vector in pack vector: time.time() for vector in pack
if vector not in self.vectors_requested}) })
self.vectors_to_get.difference_update(pack) self.vectors_to_get.difference_update(pack)
else: else:
self.send_queue.put(message.GetData(self.vectors_to_get)) self.send_queue.put(message.GetData(self.vectors_to_get))
self.vectors_requested.update({ self.vectors_requested.update({
vector: time.time() for vector in self.vectors_to_get vector: time.time() for vector in self.vectors_to_get
if vector not in self.vectors_requested}) })
self.vectors_to_get.clear() self.vectors_to_get.clear()
if self.vectors_requested: if self.vectors_requested:
self.vectors_requested = { self.vectors_requested = {