From 1035d2aec462777d44f684f3e16ff971d3d63600 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Tue, 9 Jun 2020 22:37:02 +0300 Subject: [PATCH] Format network.tcp for flake8 --- src/network/tcp.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/network/tcp.py b/src/network/tcp.py index 2136bac8..df4c9a75 100644 --- a/src/network/tcp.py +++ b/src/network/tcp.py @@ -80,8 +80,8 @@ class TCPConnection(BMProto, TLSDispatcher): try: self.local = ( protocol.checkIPAddress( - protocol.encodeHost(self.destination.host), True) and - not protocol.checkSocksIP(self.destination.host) + protocol.encodeHost(self.destination.host), True) + and not protocol.checkSocksIP(self.destination.host) ) except socket.error: # it's probably a hostname @@ -175,9 +175,9 @@ class TCPConnection(BMProto, TLSDispatcher): # and having positive or neutral rating filtered = [ (k, v) for k, v in nodes.iteritems() - if v["lastseen"] > int(time.time()) - - maximumAgeOfNodesThatIAdvertiseToOthers and - v["rating"] >= 0 and len(k.host) <= 22 + if v["lastseen"] > int(time.time()) + - maximumAgeOfNodesThatIAdvertiseToOthers + and v["rating"] >= 0 and len(k.host) <= 22 ] # sent 250 only if the remote isn't interested in it elemCount = min( @@ -408,12 +408,12 @@ class TCPServer(AdvancedDispatcher): state.ownAddresses[Peer(*sock.getsockname())] = True if ( - len(connectionpool.BMConnectionPool().inboundConnections) + - len(connectionpool.BMConnectionPool().outboundConnections) > - BMConfigParser().safeGetInt( - 'bitmessagesettings', 'maxtotalconnections') + - BMConfigParser().safeGetInt( - 'bitmessagesettings', 'maxbootstrapconnections') + 10 + len(connectionpool.BMConnectionPool().inboundConnections) + + len(connectionpool.BMConnectionPool().outboundConnections) + > BMConfigParser().safeGetInt( + 'bitmessagesettings', 'maxtotalconnections') + + BMConfigParser().safeGetInt( + 'bitmessagesettings', 'maxbootstrapconnections') + 10 ): # 10 is a sort of buffer, in between it will go through # the version handshake and return an error to the peer