1
0

lightning: enable by default but without gossip

Enables lightning by creating a node private key and storing it in
the wallet. The gossiper is not launched at start up, only if there
are existing channels.
This commit is contained in:
bitromortac
2020-10-02 07:39:36 +02:00
committed by ThomasV
parent edc593a886
commit 6045de759b
4 changed files with 30 additions and 6 deletions

View File

@@ -449,11 +449,15 @@ class LNGossip(LNWorker):
self.features |= LnFeatures.GOSSIP_QUERIES_OPT
self.features |= LnFeatures.GOSSIP_QUERIES_REQ
self.unknown_ids = set()
self.has_started = False
def start_network(self, network: 'Network'):
assert network
if self.has_started:
return
super().start_network(network)
asyncio.run_coroutine_threadsafe(self.taskgroup.spawn(self.maintain_db()), self.network.asyncio_loop)
self.has_started = True
async def maintain_db(self):
await self.channel_db.load_data()