@ -240,7 +240,6 @@ class receiveDataThread(threading.Thread):
self.sock.settimeout(600)#We'll send out a pong every 5 minutes to make sure the connection stays alive if there has been no other traffic to send lately.
self.streamNumber=streamNumber
self.payloadLength=0#This is the protocol payload length thus it doesn't include the 24 byte message header
self.receivedgetbiginv=False#Gets set to true once we receive a getbiginv message from our peer. An abusive peer might request it too much so we use this variable to check whether they have already asked for a big inv message.
shared.connectedHostsList[self.HOST]=0#The very fact that this receiveData thread exists shows that we are connected to the remote host. Let's add it to this list so that an outgoingSynSender thread doesn't try to connect to it.
self.connectionIsOrWasFullyEstablished=False#set to true after the remote node and I accept each other's version messages. This is needed to allow the user interface to accurately reflect the current number of connections.
@ -349,14 +348,10 @@ class receiveDataThread(threading.Thread):
shared.sqlSubmitQueue.put('''SELECT hash FROM inventory WHERE ((receivedtime>? and objecttype<>'pubkey') or (receivedtime>? and objecttype='pubkey')) and streamnumber=?''')
shared.sqlSubmitQueue.put('''SELECT hash FROM inventory WHERE ((receivedtime>? and objecttype<>'pubkey') or (receivedtime>? and objecttype='pubkey')) and streamnumber=?''')
print'Not including an object hash in a big inv message because the remote node is already aware of it.'#This line is here to check that this feature is working.
shared.printLock.release()
#We also have messages in our inventory in memory (which is a python dictionary). Let's fetch those too.
print'Not including an object hash in a big inv message because the remote node is already aware of it.'#This line is here to check that this feature is working.
shared.printLock.release()
#We also have messages in our inventory in memory (which is a python dictionary). Let's fetch those too.
print'Not including an object hash in a big inv message because the remote node is already aware of it.'#This line is here to check that this feature is working.
shared.printLock.release()
numberOfObjectsInInvMessage=0
payload=''
#Now let us start appending all of these hashes together. They will be sent out in a big inv message to our new peer.
forhash,storedValueinbigInvList.items():
payload+=hash
numberOfObjectsInInvMessage+=1
ifnumberOfObjectsInInvMessage>=50000:#We can only send a max of 50000 items per inv message but we may have more objects to advertise. They must be split up into multiple inv messages.
print'Not including an object hash in a big inv message because the remote node is already aware of it.'#This line is here to check that this feature is working.
shared.printLock.release()
numberOfObjectsInInvMessage=0
payload=''
#Now let us start appending all of these hashes together. They will be sent out in a big inv message to our new peer.
forhash,storedValueinbigInvList.items():
payload+=hash
numberOfObjectsInInvMessage+=1
ifnumberOfObjectsInInvMessage>=50000:#We can only send a max of 50000 items per inv message but we may have more objects to advertise. They must be split up into multiple inv messages.