URI: 
       tfix logic error in lnworker.on_channel_closed - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 75902f8e35e2a6df67667aed40bdf9c7ad6633f5
   DIR parent 427f7f8eeb0d55f327deb594008b854af916daa7
  HTML Author: SomberNight <somber.night@protonmail.com>
       Date:   Tue, 29 Oct 2019 20:39:58 +0100
       
       fix logic error in lnworker.on_channel_closed
       
       Diffstat:
         M electrum/lnwatcher.py               |       4 +++-
         M electrum/lnworker.py                |      10 +++++-----
       
       2 files changed, 8 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py
       t@@ -150,7 +150,9 @@ class LNWatcher(AddressSynchronizer):
            def get_channel_status(self, outpoint):
                return self.channel_status.get(outpoint, 'unknown')
        
       -    def add_channel(self, outpoint, address):
       +    def add_channel(self, outpoint: str, address: str) -> None:
       +        assert isinstance(outpoint, str)
       +        assert isinstance(address, str)
                self.add_address(address)
                self.channels[address] = outpoint
        
   DIR diff --git a/electrum/lnworker.py b/electrum/lnworker.py
       t@@ -638,18 +638,18 @@ class LNWallet(LNWorker):
                # create and broadcast transaction
                for prevout, sweep_info in sweep_info_dict.items():
                    name = sweep_info.name
       -            spender = spenders.get(prevout)
       -            if spender is not None:
       -                spender_tx = await self.network.get_transaction(spender)
       +            spender_txid = spenders.get(prevout)
       +            if spender_txid is not None:
       +                spender_tx = await self.network.get_transaction(spender_txid)
                        spender_tx = Transaction(spender_tx)
                        e_htlc_tx = chan.sweep_htlc(closing_tx, spender_tx)
                        if e_htlc_tx:
       -                    spender2 = spenders.get(spender_tx.outputs()[0])
       +                    spender2 = spenders.get(spender_txid+':0')
                            if spender2:
                                self.logger.info(f'htlc is already spent {name}: {prevout}')
                            else:
                                self.logger.info(f'trying to redeem htlc {name}: {prevout}')
       -                        await self.try_redeem(spender+':0', e_htlc_tx)
       +                        await self.try_redeem(spender_txid+':0', e_htlc_tx)
                        else:
                            self.logger.info(f'outpoint already spent {name}: {prevout}')
                    else: