lnworker: only reestablish channels after on-chain state is synchronized

This commit is contained in:
SomberNight 2019-08-02 18:58:38 +02:00 committed by ThomasV
parent 944e4f0ba0
commit e32807d29d

View file

@ -1045,6 +1045,9 @@ class LNWallet(LNWorker):
async def reestablish_peers_and_channels(self): async def reestablish_peers_and_channels(self):
while True: while True:
await asyncio.sleep(1) await asyncio.sleep(1)
# wait until on-chain state is synchronized
if not (self.wallet.is_up_to_date() and self.lnwatcher.is_up_to_date()):
continue
with self.lock: with self.lock:
channels = list(self.channels.values()) channels = list(self.channels.values())
for chan in channels: for chan in channels: