updated changes on bitmessagemock
This commit is contained in:
parent
c5dee5f22e
commit
d00f5ee3a8
|
@ -1,3 +1,36 @@
|
||||||
|
from class_addressGenerator import FakeAddressGenerator
|
||||||
|
from class_singleWorker import MockSingleWorker
|
||||||
|
from class_objectProcessor import MockObjectProcessor
|
||||||
|
from inventory import MockInventory
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Mock main function"""
|
"""Mock main function"""
|
||||||
pass
|
def start(self):
|
||||||
|
"""Start main application"""
|
||||||
|
# pylint: disable=too-many-statements,too-many-branches,too-many-locals
|
||||||
|
|
||||||
|
config = BMConfigParser()
|
||||||
|
daemon = config.safeGetBoolean('bitmessagesettings', 'daemon')
|
||||||
|
|
||||||
|
# Start the address generation thread
|
||||||
|
addressGeneratorThread = addressGenerator()
|
||||||
|
# close the main program even if there are threads left
|
||||||
|
addressGeneratorThread.daemon = True
|
||||||
|
addressGeneratorThread.start()
|
||||||
|
|
||||||
|
# Start the thread that calculates POWs
|
||||||
|
singleWorkerThread = MockSingleWorker()
|
||||||
|
# close the main program even if there are threads left
|
||||||
|
singleWorkerThread.daemon = True
|
||||||
|
singleWorkerThread.start()
|
||||||
|
|
||||||
|
# Start the thread that calculates POWs
|
||||||
|
objectProcessorThread = MockObjectProcessor()
|
||||||
|
# DON'T close the main program even the thread remains.
|
||||||
|
# This thread checks the shutdown variable after processing
|
||||||
|
# each object.
|
||||||
|
objectProcessorThread.daemon = False
|
||||||
|
objectProcessorThread.start()
|
||||||
|
|
||||||
|
MockInventory() # init
|
||||||
|
|
|
@ -15,7 +15,7 @@ from network import bmproto
|
||||||
logger = logging.getLogger('default')
|
logger = logging.getLogger('default')
|
||||||
|
|
||||||
|
|
||||||
class objectProcessor(threading.Thread):
|
class MockObjectProcessor(threading.Thread):
|
||||||
"""
|
"""
|
||||||
The objectProcessor thread, of which there is only one, receives network
|
The objectProcessor thread, of which there is only one, receives network
|
||||||
objects (msg, broadcast, pubkey, getpubkey) from the receiveDataThreads.
|
objects (msg, broadcast, pubkey, getpubkey) from the receiveDataThreads.
|
||||||
|
|
Reference in New Issue
Block a user