diff --git a/src/network/asyncore_pollchoose.py b/src/network/asyncore_pollchoose.py index 0c7198db..3f6e8ad0 100644 --- a/src/network/asyncore_pollchoose.py +++ b/src/network/asyncore_pollchoose.py @@ -249,7 +249,7 @@ def select_poller(timeout=0.0, map=None): rd = [] wt = [] ex = [] - for fd, obj in map.items(): + for fd, obj in list(map.items()): is_r = obj.readable() is_w = obj.writable() if is_r: @@ -660,9 +660,6 @@ class dispatcher: def readable(self): """Predicate to indicate download throttle status""" - print('-------------------------------------') - print('---------------asyncore--------------') - print('-------------------------------------') if maxDownloadRate > 0: return downloadBucket > dispatcher.minTx return True diff --git a/src/network/bmproto.py b/src/network/bmproto.py index f6ded3ca..772e4eaf 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -106,20 +106,16 @@ class BMProto(AdvancedDispatcher, ObjectTracker): count+=1 if self.command == 'verack'.encode(): addr_verack+=1 - print('the addr_verack count are -{}'.format(addr_verack)) + # print('the addr_verack count are -{}'.format(addr_verack)) if self.command == 'version'.encode(): addr_version+=1 - print('the addr_version count are -{}'.format(addr_version)) + # print('the addr_version count are -{}'.format(addr_version)) if self.command == 'addr'.encode(): addr_count+=1 - print('the addr_count count are -{}'.format(addr_count)) + # print('the addr_count count are -{}'.format(addr_count)) - # print('The count of the excaution are -{}'.format(count)) - # print('-----------count---------------{}'.format(count)) - # print('------self command-----------{}'.format(self.command)) - # print('----------self---------------{}'.format(self)) if self.magic != 0xE9BEB4D9: # skip 1 byte in order to sync #in the advancedispatched and length commend's @@ -569,17 +565,17 @@ class BMProto(AdvancedDispatcher, ObjectTracker): logger.debug( '%(host)s:%(port)i sending version', self.destination._asdict()) - if ((self.services & protocol.NODE_SSL == protocol.NODE_SSL) and - protocol.haveSSL(not self.isOutbound)): - self.isSSL = True + if ((self.services & protocol.NODE_SSL == protocol.NODE_SSL)): + # self.isSSL = True + pass if not self.verackReceived: return True - # print('inside the bmproto line') - # print('before the value of state are :-{}'.format(self.state)) + # self.set_state( + # "tls_init" if self.isSSL else "connection_fully_established", + # length=self.payloadLength, expectBytes=0) self.set_state( - "tls_init" if self.isSSL else "connection_fully_established", + "connection_fully_established", length=self.payloadLength, expectBytes=0) - # print('After the value of state are :-{}'.format(self.state)) return False def peerValidityChecks(self): # pylint: disable=too-many-return-statements diff --git a/src/network/stats.py b/src/network/stats.py index b6ac4f4b..e6c37499 100644 --- a/src/network/stats.py +++ b/src/network/stats.py @@ -32,7 +32,7 @@ def connectedHostsList(): retval.append(i) except AttributeError: pass - # print('#################### retval -{}'.format(retval)) + return retval diff --git a/src/network/tls.py b/src/network/tls.py index 73f64e4e..0a6bcd91 100644 --- a/src/network/tls.py +++ b/src/network/tls.py @@ -84,7 +84,6 @@ class TLSDispatcher(AdvancedDispatcher): # pylint: disable=too-many-instanc # also exclude TLSv1 and TLSv1.1 in the future context.options = ssl.OP_ALL | ssl.OP_NO_SSLv2 |\ ssl.OP_NO_SSLv3 | ssl.OP_SINGLE_ECDH_USE | ssl.OP_CIPHER_SERVER_PREFERENCE - self.sslSocket = context.wrap_socket( self.socket, server_side=self.server_side, do_handshake_on_connect=False) else: