This fixes a regression where the plugin was assuming ordering for
txin.pubkeys (which is now a set).
(previously txin.pubkeys was a list ordered according to the final
sort order of keys inside the bitcoin script)
follow-up 719b468eee
Traceback (most recent call last):
File "...\electrum\electrum\gui\qt\history_list.py", line 673, in mouseDoubleClickEvent
self.parent.show_lightning_transaction(tx_item)
File "...\electrum\electrum\gui\qt\main_window.py", line 1082, in show_lightning_transaction
d = LightningTxDialog(self, tx_item)
File "...\electrum\electrum\gui\qt\lightning_tx_dialog.py", line 60, in __init__
self.invoice = invoice.lightning_invoice
AttributeError: 'Request' object has no attribute 'lightning_invoice'
follow-up 719b468eee
Traceback (most recent call last):
File "...\electrum\electrum\gui\qt\request_list.py", line 111, in item_changed
self.receive_tab.update_current_request()
File "...\electrum\electrum\gui\qt\receive_tab.py", line 227, in update_current_request
lnaddr = self.wallet.get_bolt11_invoice(req) if not help_texts.ln_is_error else ''
File "...\electrum\electrum\wallet.py", line 2515, in get_bolt11_invoice
amount_msat = req.amount_msat if req.amount_msat > 0 else None
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Due to swaphelper's lifecycle (it is kept around longer than the swap dialog) it might
get initialized with a non-lightning wallet. don't initialize in that case.
proper fix is to tie the lifecycle to the swap process, or make it a child of the wallet.
This fixes a bug where if one runs `wallet.clear_history()` they would see exceptions later:
```
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 866, in timer_actions
self.update_wallet()
File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1021, in update_wallet
self.update_tabs()
File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1033, in update_tabs
self.utxo_list.update()
File "/home/user/wspace/electrum/electrum/gui/qt/utxo_list.py", line 103, in update
self.refresh_row(name, idx)
File "/home/user/wspace/electrum/electrum/gui/qt/utxo_list.py", line 124, in refresh_row
parents = self.wallet.get_tx_parents(txid)
File "/home/user/wspace/electrum/electrum/wallet.py", line 885, in get_tx_parents
result.update(self.get_tx_parents(_txid))
File "/home/user/wspace/electrum/electrum/wallet.py", line 881, in get_tx_parents
for i, txin in enumerate(tx.inputs()):
AttributeError: 'NoneType' object has no attribute 'inputs'
```
This is related to the privacy analysis, which assumes that for each tx item in the history list
we should have the raw tx in the db. This is no longer true after wallet.clear_history(), if
the wallet has certain LN channels. E.g. an already redeemed channel that was local-force-closed,
as that closing tx is not related to the wallet directly.
In commit 3541ecb576, we decided not to watch already redeemed channels.
This is potentially good for e.g. privacy, as the server would otherwise see us subscribe to that chan.
However it means that after running wallet.clear_history() txs related to the channel but not to the
wallet won't be re-downloaded.
Instead, now if there are missing txs for a redeemed channel, we start watching it, hence the
synchronizer will re-downloaded the txs.