run lnworker.main_loop directly on the event loop

This commit is contained in:
ThomasV 2020-04-14 18:28:23 +02:00
parent 1d667fe932
commit 73325831b7

View file

@ -232,11 +232,10 @@ class LNWorker(Logger):
assert network assert network
self.network = network self.network = network
self.config = network.config self.config = network.config
daemon = network.daemon
self.channel_db = self.network.channel_db self.channel_db = self.network.channel_db
self._last_tried_peer = {} # type: Dict[LNPeerAddr, float] # LNPeerAddr -> unix timestamp self._last_tried_peer = {} # type: Dict[LNPeerAddr, float] # LNPeerAddr -> unix timestamp
self._add_peers_from_config() self._add_peers_from_config()
asyncio.run_coroutine_threadsafe(daemon.taskgroup.spawn(self.main_loop()), self.network.asyncio_loop) asyncio.run_coroutine_threadsafe(self.main_loop(), self.network.asyncio_loop)
def _add_peers_from_config(self): def _add_peers_from_config(self):
peer_list = self.config.get('lightning_peers', []) peer_list = self.config.get('lightning_peers', [])