diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py index 45077c13b..e00d5a615 100644 --- a/electrum/lnwatcher.py +++ b/electrum/lnwatcher.py @@ -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 diff --git a/electrum/lnworker.py b/electrum/lnworker.py index c22327c3c..d1865057b 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -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: