From 26962e57e3c6b9da9c94a4af36ea738b77018a0e Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Wed, 2 Jun 2021 15:49:07 +0800 Subject: [PATCH] Code quality --- src/network/tls.py | 2 +- src/network/udp.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/network/tls.py b/src/network/tls.py index a3774b44..b0211cc3 100644 --- a/src/network/tls.py +++ b/src/network/tls.py @@ -44,7 +44,7 @@ else: class TLSDispatcher(AdvancedDispatcher): """TLS functionality for classes derived from AdvancedDispatcher""" # pylint: disable=too-many-instance-attributes, too-many-arguments - # pylint: disable=super-init-not-called + # pylint: disable=super-init-not-called, unused-argument def __init__(self, _=None, sock=None, certfile=None, keyfile=None, server_side=False, ciphers=sslProtocolCiphers): self.want_read = self.want_write = True diff --git a/src/network/udp.py b/src/network/udp.py index 3f999332..17af9991 100644 --- a/src/network/udp.py +++ b/src/network/udp.py @@ -21,7 +21,7 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes port = 8444 def __init__(self, host=None, sock=None, announcing=False): - # pylint: disable=bad-super-call + # pylint: disable=bad-super-call, access-member-before-definition super(BMProto, self).__init__(sock=sock) self.verackReceived = True self.verackSent = True @@ -97,22 +97,30 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes time.time() return True + # override the protocol do ignore the following commands on UDP + # we do this mainly for security reasons def bm_command_portcheck(self): + # pylint: disable=no-self-use return True def bm_command_ping(self): + # pylint: disable=no-self-use return True def bm_command_pong(self): + # pylint: disable=no-self-use return True def bm_command_verack(self): + # pylint: disable=no-self-use return True def bm_command_version(self): + # pylint: disable=no-self-use return True def handle_connect(self): + # pylint: disable=no-self-use return def writable(self):