1
0

Use separate lightning nodes for gossip and channel operations.

This commit is contained in:
ThomasV
2019-04-26 12:48:02 +02:00
parent 12743bda93
commit 730be17aba
5 changed files with 215 additions and 186 deletions

View File

@@ -298,10 +298,12 @@ class Network(Logger):
# lightning network
from . import lnwatcher
from . import lnworker
from . import lnrouter
self.channel_db = lnrouter.ChannelDB(self)
self.path_finder = lnrouter.LNPathFinder(self.channel_db)
self.lnwatcher = lnwatcher.LNWatcher(self)
self.lngossip = lnworker.LNGossip(self)
def run_from_another_thread(self, coro):
assert self._loop_thread != threading.current_thread(), 'must not be called from network thread'
@@ -1158,6 +1160,8 @@ class Network(Logger):
asyncio.run_coroutine_threadsafe(main(), self.asyncio_loop)
self.trigger_callback('network_updated')
#
self.lngossip.start_network(self)
def start(self, jobs: List=None):
self._jobs = jobs or []