diff --git a/bitmessagemain.py b/bitmessagemain.py index 195e0114..1bd4a2a0 100644 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -186,14 +186,17 @@ class singleListener(QThread): while config.get('bitmessagesettings', 'socksproxytype')[0:5] == 'SOCKS': time.sleep(10) a,(HOST,PORT) = sock.accept() - while HOST in connectedHostsList: + #Users are finding that if they run more than one node in the same network (thus with the same public IP), they can not connect with the second node. This is because this section of code won't accept the connection from the same IP. This problem will go away when the Bitmessage network grows behond being tiny but in the mean time, I'll comment out this code section. + """while HOST in connectedHostsList: print 'incoming connection is from a host in connectedHostsList (we are already connected to it). Ignoring it.' a.close() - a,(HOST,PORT) = sock.accept() + a,(HOST,PORT) = sock.accept()""" rd = receiveDataThread() self.emit(SIGNAL("passObjectThrough(PyQt_PyObject)"),rd) rd.setup(a,HOST,PORT,-1,self.incomingConnectionList) + printLock.acquire() print self, 'connected to', HOST,'during INCOMING request.' + printLock.release() rd.start() sd = sendDataThread() @@ -241,7 +244,7 @@ class receiveDataThread(QThread): break except Exception, err: printLock.acquire() - print 'sock.recv error. Closing receiveData thread.' + print 'sock.recv error. Closing receiveData thread.', err printLock.release() break #print 'Received', repr(self.data) @@ -274,7 +277,6 @@ class receiveDataThread(QThread): try: del connectedHostsList[self.HOST] except Exception, err: - #I think that the only way an exception could occur here is if we connect to ourselves because it would try to delete the same IP from connectedHostsList twice. print 'Could not delete', self.HOST, 'from connectedHostsList.', err def processData(self): @@ -534,6 +536,8 @@ class receiveDataThread(QThread): sendersPubkey = rsa.PublicKey(convertStringToInt(nString),convertStringToInt(eString)) #print 'senders Pubkey', sendersPubkey try: + #You may notice that this signature doesn't cover any information that identifies the RECEIVER of the message. This makes it vulnerable to a malicious receiver Bob forwarding the message from Alice to Charlie, making it look like Alice sent the message to Charlie. This will be fixed in the next version. + #See http://world.std.com/~dtd/sign_encrypt/sign_encrypt7.html rsa.verify(self.data[readPositionAtBeginningOfMessageEncodingType:readPositionAtBeginningOfMessageEncodingType+messageEncodingTypeLength+messageLengthLength+messageLength],signature,sendersPubkey) print 'verify passed' except Exception, err: diff --git a/defaultKnownNodes.py b/defaultKnownNodes.py index 60a0ef55..6ce994e6 100644 --- a/defaultKnownNodes.py +++ b/defaultKnownNodes.py @@ -11,7 +11,7 @@ def createDefaultKnownNodes(appdata): stream1 = {} stream1['75.186.58.44'] = (8080,int(time.time())) - stream1['69.201.157.85'] = (8080,int(time.time())) + stream1['66.108.170.195'] = (8080,int(time.time())) stream1['91.201.118.59'] = (8444,int(time.time())) stream1['188.122.235.58'] = (8444,int(time.time()))