Pass config and state to network.start()
This commit is contained in:
parent
54790ac2d9
commit
37344930f6
|
@ -236,17 +236,8 @@ class Main(object):
|
|||
# start network components if networking is enabled
|
||||
if state.enableNetwork:
|
||||
start_proxyconfig()
|
||||
network.start()
|
||||
network.start(config, state)
|
||||
|
||||
# Optional components
|
||||
for i in range(config.getint('threads', 'receive')):
|
||||
receiveQueueThread = network.ReceiveQueueThread(i)
|
||||
receiveQueueThread.daemon = True
|
||||
receiveQueueThread.start()
|
||||
if config.safeGetBoolean('bitmessagesettings', 'udp'):
|
||||
state.announceThread = network.AnnounceThread()
|
||||
state.announceThread.daemon = True
|
||||
state.announceThread.start()
|
||||
if config.safeGetBoolean('bitmessagesettings', 'upnp'):
|
||||
import upnp
|
||||
upnpThread = upnp.uPnPThread()
|
||||
|
|
|
@ -4,19 +4,17 @@ Network subsystem package
|
|||
|
||||
from announcethread import AnnounceThread
|
||||
from connectionpool import BMConnectionPool
|
||||
from receivequeuethread import ReceiveQueueThread
|
||||
from threads import StoppableThread
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AnnounceThread", "BMConnectionPool",
|
||||
"ReceiveQueueThread", "StoppableThread"
|
||||
"AnnounceThread", "BMConnectionPool", "StoppableThread"
|
||||
# "AddrThread", "AnnounceThread", "BMNetworkThread", "Dandelion",
|
||||
# "DownloadThread", "InvThread", "UploadThread",
|
||||
# "DownloadThread", "InvThread", "ReceiveQueueThread", "UploadThread",
|
||||
]
|
||||
|
||||
|
||||
def start():
|
||||
def start(config, state):
|
||||
"""Start network threads"""
|
||||
from addrthread import AddrThread
|
||||
from dandelion import Dandelion
|
||||
|
@ -24,6 +22,7 @@ def start():
|
|||
from invthread import InvThread
|
||||
from networkthread import BMNetworkThread
|
||||
from knownnodes import readKnownNodes
|
||||
from receivequeuethread import ReceiveQueueThread
|
||||
from uploadthread import UploadThread
|
||||
|
||||
readKnownNodes()
|
||||
|
@ -45,3 +44,13 @@ def start():
|
|||
uploadThread = UploadThread()
|
||||
uploadThread.daemon = True
|
||||
uploadThread.start()
|
||||
|
||||
# Optional components
|
||||
for i in range(config.getint('threads', 'receive')):
|
||||
receiveQueueThread = ReceiveQueueThread(i)
|
||||
receiveQueueThread.daemon = True
|
||||
receiveQueueThread.start()
|
||||
if config.safeGetBoolean('bitmessagesettings', 'udp'):
|
||||
state.announceThread = AnnounceThread()
|
||||
state.announceThread.daemon = True
|
||||
state.announceThread.start()
|
||||
|
|
Reference in New Issue
Block a user