From d3ef469c5f92b263726dd1aba2b0a8e9d74e4c0e Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 20 Feb 2013 19:56:21 -0500 Subject: [PATCH] Handle case where remote node is interested in stream 0 (shouldn't happen naturally) --- bitmessagemain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 0f17097d..db570fb2 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -1796,16 +1796,16 @@ class receiveDataThread(QThread): printLock.acquire() print 'Remote node useragent:', useragent, ' stream number:', self.streamNumber printLock.release() - #If this was an incoming connection, then the sendData thread doesn't know the stream. We have to set it. - if not self.initiatedConnection: - broadcastToSendDataQueues((0,'setStreamNumber',(self.HOST,self.streamNumber))) if self.streamNumber != 1: self.sock.close() printLock.acquire() - print 'Closed connection to', self.HOST, 'because they are interested in stream', self.steamNumber,'.' + print 'Closed connection to', self.HOST, 'because they are interested in stream', self.streamNumber,'.' printLock.release() self.data = '' return + #If this was an incoming connection, then the sendData thread doesn't know the stream. We have to set it. + if not self.initiatedConnection: + broadcastToSendDataQueues((0,'setStreamNumber',(self.HOST,self.streamNumber))) if self.data[96:104] == eightBytesOfRandomDataUsedToDetectConnectionsToSelf: self.sock.close() printLock.acquire() -- 2.45.1