@ -181,7 +181,7 @@ class outgoingSynSender(QThread):
knownNodesLock.release()
print'deleting ',HOST,'from knownNodes because it is more than 48 hours old and we could not connect to it.'
exceptException,err:
print'An exception has occurred in the outgoingSynSender thread that was not caught by other exception types:',err
sys.stderr.write('An exception has occurred in the outgoingSynSender thread that was not caught by other exception types:%s\n'%err)
time.sleep(0.1)
#Only one singleListener thread will ever exist. It creates the receiveDataThread and sendDataThread for each incoming connection. Note that it cannot set the stream number because it is not known yet- the other node will have to tell us its stream number in a version message. If we don't care about their stream, we will close the connection (within the recversion function of the recieveData thread)
@ -1475,14 +1475,11 @@ class receiveDataThread(QThread):
print'knownNodes currently has',len(knownNodes[self.streamNumber]),'nodes for this stream.'
printLock.release()
elifself.remoteProtocolVersion>=2:#The difference is that in protocol version 2, network addresses use 64 bit times rather than 32 bit times.
print'addr message does not contain the correct amount of data. Ignoring.'
return
else:
print'len of addr data is correct:',len(data)
needToWriteKnownNodesToDisk=False
foriinrange(0,numberOfAddressesIncluded):
@ -1728,39 +1725,10 @@ class receiveDataThread(QThread):
#Sends a version message
defsendversion(self):
globalsoftwareVersion
payload=''
payload+=pack('>L',2)#protocol version.
payload+=pack('>q',1)#bitflags of the services I offer.
payload+=pack('>q',int(time.time()))
payload+=pack('>q',1)#boolservices offered by the remote node. This data is ignored by the remote host because how could We know what Their services are without them telling us?
payload+=pack('>H',self.PORT)#remote IPv6 and port
payload+=pack('>q',1)#bitflags of the services I offer.
payload+='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF'+pack('>L',2130706433)# = 127.0.0.1. This will be ignored by the remote host. The actual remote connected IP will be used.
payload+=pack('>H',config.getint('bitmessagesettings','port'))#my external IPv6 and port
payload+=pack('>H',self.PORT)#remote IPv6 and port
payload+=pack('>q',1)#bitflags of the services I offer.
payload+='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF'+pack('>L',2130706433)# = 127.0.0.1. This will be ignored by the remote host. The actual remote connected IP will be used.
payload+=pack('>H',config.getint('bitmessagesettings','port'))#my external IPv6 and port
payload+=pack('>H',remotePort)#remote IPv6 and port
payload+=pack('>q',1)#bitflags of the services I offer.
payload+='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF'+pack('>L',2130706433)# = 127.0.0.1. This will be ignored by the remote host. The actual remote connected IP will be used.
payload+=pack('>H',config.getint('bitmessagesettings','port'))#my external IPv6 and port
#This thread exists because SQLITE3 is so un-threadsafe that we must submit queries to it and it puts results back in a different queue. They won't let us just use locks.