Skip to content

Commit

Permalink
Resolved pylint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
g1itch committed May 10, 2019
1 parent 453e045 commit 01d4fbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/class_objectProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def checkackdata(self, data):
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
Expand All @@ -160,7 +162,9 @@ def processonion(self, data):
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.'
Expand Down
3 changes: 2 additions & 1 deletion src/class_singleWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def run(self):
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
Expand Down Expand Up @@ -470,6 +470,7 @@ def sendOutOrStoreMyV4Pubkey(self, myAddress):
)

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
Expand Down

0 comments on commit 01d4fbe

Please sign in to comment.