invthread pylint fixes
This commit is contained in:
parent
97cbe43294
commit
ef77a9816e
|
@ -1,3 +1,7 @@
|
||||||
|
"""
|
||||||
|
src/network/invthread.py
|
||||||
|
========================
|
||||||
|
"""
|
||||||
import Queue
|
import Queue
|
||||||
import random
|
import random
|
||||||
from time import time
|
from time import time
|
||||||
|
@ -32,9 +36,13 @@ def handleExpiredDandelion(expired):
|
||||||
|
|
||||||
|
|
||||||
class InvThread(StoppableThread):
|
class InvThread(StoppableThread):
|
||||||
|
"""A thread to manage inventory"""
|
||||||
|
|
||||||
name = "InvBroadcaster"
|
name = "InvBroadcaster"
|
||||||
|
|
||||||
def handleLocallyGenerated(self, stream, hashId):
|
@staticmethod
|
||||||
|
def handleLocallyGenerated(stream, hashId):
|
||||||
|
"""Locally generated inventory items require special handling"""
|
||||||
Dandelion().addHash(hashId, stream=stream)
|
Dandelion().addHash(hashId, stream=stream)
|
||||||
for connection in \
|
for connection in \
|
||||||
BMConnectionPool().inboundConnections.values() + \
|
BMConnectionPool().inboundConnections.values() + \
|
||||||
|
@ -43,8 +51,8 @@ class InvThread(StoppableThread):
|
||||||
continue
|
continue
|
||||||
connection.objectsNewToThem[hashId] = time()
|
connection.objectsNewToThem[hashId] = time()
|
||||||
|
|
||||||
def run(self):
|
def run(self): # pylint: disable=too-many-branches
|
||||||
while not state.shutdown:
|
while not state.shutdown: # pylint: disable=too-many-nested-blocks
|
||||||
chunk = []
|
chunk = []
|
||||||
while True:
|
while True:
|
||||||
# Dandelion fluff trigger by expiration
|
# Dandelion fluff trigger by expiration
|
||||||
|
|
Loading…
Reference in New Issue
Block a user