From 77651eebe3536023e98e47e1c42498b204c29af4 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Thu, 5 Sep 2019 20:09:11 +0530 Subject: [PATCH] objecttracker flake8 fixes --- src/network/objectracker.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/network/objectracker.py b/src/network/objectracker.py index f119b2d8..304cbc65 100644 --- a/src/network/objectracker.py +++ b/src/network/objectracker.py @@ -85,15 +85,15 @@ class ObjectTracker(object): self.objectsNewToMe[hashId] = True def handleReceivedObject(self, streamNumber, hashid): - for i in network.connectionpool.BMConnectionPool().inboundConnections.values() + network.connectionpool.BMConnectionPool().outboundConnections.values(): + for i in network.connectionpool.BMConnectionPool().inboundConnections.values( + ) + network.connectionpool.BMConnectionPool().outboundConnections.values(): if not i.fullyEstablished: continue try: del i.objectsNewToMe[hashid] except KeyError: - if streamNumber in i.streams and \ - (not Dandelion().hasHash(hashid) or \ - Dandelion().objectChildStem(hashid) == i): + if streamNumber in i.streams and ( + not Dandelion().hasHash(hashid) or Dandelion().objectChildStem(hashid) == i): with i.objectsNewToThemLock: i.objectsNewToThem[hashid] = time.time() # update stream number, which we didn't have when we just received the dinv @@ -116,16 +116,18 @@ class ObjectTracker(object): if haveBloom: self.addrBloom.add(hashid) -# addr sending -> per node upload queue, and flush every minute or so -# inv sending -> if not in bloom, inv immediately, otherwise put into a per node upload queue and flush every minute or so -# data sending -> a simple queue -# no bloom -# - if inv arrives -# - if we don't have it, add tracking and download queue -# - if we do have it, remove from tracking -# tracking downloads -# - per node hash of items the node has but we don't -# tracking inv -# - per node hash of items that neither the remote node nor we have -# +""" + addr sending -> per node upload queue, and flush every minute or so + inv sending -> if not in bloom, inv immediately, otherwise put into a per node upload queue + and flush every minute or so + data sending -> a simple queue + no bloom + - if inv arrives + - if we don't have it, add tracking and download queue + - if we do have it, remove from tracking + tracking downloads + - per node hash of items the node has but we don't + tracking inv + - per node hash of items that neither the remote node nor we have +"""