From 853c8561ec4b936531902a28e33f087686332907 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Mon, 10 Jul 2017 07:12:52 +0200 Subject: [PATCH] Per connection node id part 2 - forgot to include this in the previous commit --- src/network/bmproto.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index 78149726..d2b5fa1f 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -362,7 +362,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): self.verackSent = True if not self.isOutbound: 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) if ((self.services & protocol.NODE_SSL == protocol.NODE_SSL) and protocol.haveSSL(not self.isOutbound)): @@ -414,7 +414,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): return False except: pass - if self.nonce == protocol.eightBytesOfRandomDataUsedToDetectConnectionsToSelf: + if network.connectionpool.BMConnectionPool().isAlreadyConnected(self.nonce): self.append_write_buf(protocol.assembleErrorMessage(fatal=2, errorText="I'm connected to myself. Closing connection.")) logger.debug ("Closed connection to %s because I'm connected to myself.",