Per connection node id part 2

- forgot to include this in the previous commit
This commit is contained in:
Peter Šurda 2017-07-10 07:12:52 +02:00
parent 3941b39136
commit 853c8561ec
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -362,7 +362,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
self.verackSent = True self.verackSent = True
if not self.isOutbound: if not self.isOutbound:
self.append_write_buf(protocol.assembleVersionMessage(self.destination.host, self.destination.port, \ self.append_write_buf(protocol.assembleVersionMessage(self.destination.host, self.destination.port, \
network.connectionpool.BMConnectionPool().streams, True)) network.connectionpool.BMConnectionPool().streams, True, nodeid=self.nodeid))
#print "%s:%i: Sending version" % (self.destination.host, self.destination.port) #print "%s:%i: Sending version" % (self.destination.host, self.destination.port)
if ((self.services & protocol.NODE_SSL == protocol.NODE_SSL) and if ((self.services & protocol.NODE_SSL == protocol.NODE_SSL) and
protocol.haveSSL(not self.isOutbound)): protocol.haveSSL(not self.isOutbound)):
@ -414,7 +414,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
return False return False
except: except:
pass pass
if self.nonce == protocol.eightBytesOfRandomDataUsedToDetectConnectionsToSelf: if network.connectionpool.BMConnectionPool().isAlreadyConnected(self.nonce):
self.append_write_buf(protocol.assembleErrorMessage(fatal=2, self.append_write_buf(protocol.assembleErrorMessage(fatal=2,
errorText="I'm connected to myself. Closing connection.")) errorText="I'm connected to myself. Closing connection."))
logger.debug ("Closed connection to %s because I'm connected to myself.", logger.debug ("Closed connection to %s because I'm connected to myself.",