Resolved pylint warnings

python3android
Dmitri Bogomolov 3 years ago
parent 453e045ae5
commit 01d4fbe60b
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
  1. 8
      src/class_objectProcessor.py
  2. 3
      src/class_singleWorker.py

@ -143,7 +143,9 @@ class objectProcessor(threading.Thread):
else:
logger.debug('This object is not an acknowledgement bound for me.')
def processonion(self, data):
@staticmethod
def processonion(data):
"""Process onionpeer object"""
readPosition = 20 # bypass the nonce, time, and object type
length = decodeVarint(data[readPosition:readPosition + 10])[1]
readPosition += length
@ -160,7 +162,9 @@ class objectProcessor(threading.Thread):
knownnodes.addKnownNode(
stream, peer, is_self=state.ownAddresses.get(peer))
def processgetpubkey(self, data):
@staticmethod
def processgetpubkey(data):
"""Process getpubkey object"""
if len(data) > 200:
logger.info(
'getpubkey is abnormally long. Sanity check failed.'

@ -130,7 +130,7 @@ class singleWorker(threading.Thread, StoppableThread):
queues.workerQueue.put(('sendbroadcast', ''))
# send onionpeer object
for peer in state.ownAddresses.keys():
for peer in state.ownAddresses:
if peer.host.endswith('.onion'):
queues.workerQueue.put(('sendOnionPeerObj', peer))
break
@ -470,6 +470,7 @@ class singleWorker(threading.Thread, StoppableThread):
)
def sendOnionPeerObj(self, peer):
"""Send onionpeer object representing peer"""
TTL = int(7 * 24 * 60 * 60 + helper_random.randomrandrange(-300, 300))
embeddedTime = int(time.time() + TTL)
streamNumber = 1 # Don't know yet what should be here

Loading…
Cancel
Save