Rename maybe_init_lightning(). Call load_data() from there
This commit is contained in:
@@ -448,8 +448,7 @@ class Daemon(Logger):
|
||||
if self.network:
|
||||
self.network.start(jobs=[self.fx.run])
|
||||
# prepare lightning functionality, also load channel db early
|
||||
self.network.maybe_init_lightning()
|
||||
self.network.channel_db.load_data()
|
||||
self.network.init_channel_db()
|
||||
|
||||
self.taskgroup = TaskGroup()
|
||||
asyncio.run_coroutine_threadsafe(self._run(jobs=daemon_jobs), self.asyncio_loop)
|
||||
|
||||
@@ -347,12 +347,13 @@ class Network(Logger, NetworkRetryManager[ServerAddr]):
|
||||
def has_channel_db(self):
|
||||
return self.channel_db is not None
|
||||
|
||||
def maybe_init_lightning(self):
|
||||
def init_channel_db(self):
|
||||
if self.channel_db is None:
|
||||
from . import lnrouter
|
||||
from . import channel_db
|
||||
self.channel_db = channel_db.ChannelDB(self)
|
||||
self.path_finder = lnrouter.LNPathFinder(self.channel_db)
|
||||
self.channel_db.load_data()
|
||||
|
||||
def start_gossip(self):
|
||||
if self.lngossip is None:
|
||||
|
||||
Reference in New Issue
Block a user