print'The size of the connectedHostsList is now:',len(shared.connectedHostsList)
@ -386,15 +390,24 @@ class receiveDataThread(threading.Thread):
shared.printLock.acquire()
print'(concerning',self.HOST+')','number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)
print'(concerning',self.HOST+')','number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)
print'(concerning',self.HOST+')','number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)
print'number of keys(hosts) in numberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHavePerPeer:',len(numberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHavePerPeer)
print'We already have',totalNumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave,'items yet to retrieve from peers. Ignoring this inv message.'
print'We already have',totalNumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave,'items yet to retrieve from peers and over 1000 from this node in particular. Ignoring this inv message.'
foriinrange(numberOfItemsInInv):#upon finishing dealing with an incoming message, the receiveDataThread will request a random object from the peer. This way if we get multiple inv messages from multiple peers which list mostly the same objects, we will make getdata requests for different random objects from the various peers.
iflen(data[lengthOfVarint+(32*i):32+lengthOfVarint+(32*i)])==32:#The length of an inventory hash should be 32. If it isn't 32 then the remote node is either badly programmed or behaving nefariously.
print'We already have',totalNumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave,'items yet to retrieve from peers and over',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave),'from this node in particular. Ignoring the rest of this inv message.'
successfullyDecryptMessageTimings=[]#A list of the amounts of time it took to successfully decrypt msg messages
apiAddressGeneratorReturnQueue=Queue.Queue()#The address generator thread uses this queue to get information back to the API thread.
alreadyAttemptedConnectionsListResetTime=int(time.time())#used to clear out the alreadyAttemptedConnectionsList periodically so that we will retry connecting to hosts to which we have already tried to connect.