mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
Minor refactor
Runs chain_monitor as daemon so it terminates along with the main thread. Reorders attack_responder so it is in the same stanza as attack_watcher
This commit is contained in:
@@ -53,11 +53,11 @@ class ChainMonitor:
|
||||
|
||||
def monitor_chain(self):
|
||||
self.best_tip = BlockProcessor.get_best_block_hash()
|
||||
Thread(target=self.monitor_chain_polling).start()
|
||||
Thread(target=self.monitor_chain_zmq).start()
|
||||
Thread(target=self.monitor_chain_polling, daemon=True).start()
|
||||
Thread(target=self.monitor_chain_zmq, daemon=True).start()
|
||||
|
||||
def monitor_chain_polling(self):
|
||||
while self.terminate:
|
||||
while not self.terminate:
|
||||
self.check_tip.wait(timeout=60)
|
||||
|
||||
# Terminate could have been set wile the thread was blocked in wait
|
||||
|
||||
Reference in New Issue
Block a user