URI: 
       tIgnore exceptions raised in lnworker.on_network_update. Exception raised there may cancel the network's main taskgroup. - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 5ec1db4d51f0abf0e4327b6471b00dda6096572c
   DIR parent d0cfb3ae12dca88ed51f23d68cd2b60a0b46b017
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Fri, 30 Aug 2019 09:54:32 +0200
       
       Ignore exceptions raised in lnworker.on_network_update.
       Exception raised there may cancel the network's main taskgroup.
       
       Diffstat:
         M electrum/lnworker.py                |      10 +++++++++-
       
       1 file changed, 9 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/electrum/lnworker.py b/electrum/lnworker.py
       t@@ -377,6 +377,7 @@ class LNWallet(LNWorker):
                        self.sync_with_local_watchtower(),
                        self.sync_with_remote_watchtower(),
                ]:
       +            # FIXME: exceptions in those coroutines will cancel network.main_taskgroup
                    asyncio.run_coroutine_threadsafe(self.network.main_taskgroup.spawn(coro), self.network.asyncio_loop)
        
            def peer_closed(self, peer):
       t@@ -570,6 +571,7 @@ class LNWallet(LNWorker):
                    self.channel_db.remove_channel(chan.short_channel_id)
                # detect who closed and set sweep_info
                sweep_info = chan.sweep_ctx(closing_tx)
       +        self.logger.info(f'sweep_info length: {len(sweep_info)}')
                # create and broadcast transaction
                for prevout, e_tx in sweep_info.items():
                    name, csv_delay, cltv_expiry, gen_tx = e_tx
       t@@ -662,6 +664,7 @@ class LNWallet(LNWorker):
                                                               500_000)
                return total_value_sat > min_value_worth_closing_channel_over_sat
        
       +    @ignore_exceptions
            @log_exceptions
            async def on_network_update(self, event, *args):
                # TODO
       t@@ -676,6 +679,7 @@ class LNWallet(LNWorker):
                    if chan.is_closed():
                        continue
                    if chan.get_state() != 'CLOSED' and self.should_channel_be_closed_due_to_expiring_htlcs(chan):
       +                self.logger.info(f"force-closing due to expiring htlcs")
                        await self.force_close_channel(chan.channel_id)
                        continue
                    if chan.short_channel_id is None:
       t@@ -1043,7 +1047,11 @@ class LNWallet(LNWorker):
                chan.set_force_closed()
                self.save_channel(chan)
                self.on_channels_updated()
       -        await self.network.broadcast_transaction(tx)
       +        try:
       +            await self.network.broadcast_transaction(tx)
       +        except Exception as e:
       +            self.logger.info(f'could NOT publish {tx.txid()}, {str(e)}')
       +            return
                return tx.txid()
        
            def remove_channel(self, chan_id):