In one wallet, before this, make_unsigned_transaction() took 120 sec,
now it takes ~8 sec.
hot path:
```
make_unsigned_transaction (electrum/wallet.py:1696)
add_input_info (electrum/wallet.py:2261)
utxo (electrum/transaction.py:289)
tx_from_any (electrum/transaction.py:1232)
deserialize (electrum/transaction.py:805)
<listcomp> (electrum/transaction.py:805)
parse_output (electrum/transaction.py:706)
__init__ (electrum/transaction.py:127)
scriptpubkey (electrum/transaction.py:173)
get_address_from_output_script (electrum/transaction.py:672)
```
We were re-calculating txin.address from the prevtx-utxo on every call,
e.g. in electrum/gui/qt/utxo_list.py#L103 (for every utxo in the wallet).
For a wallet with ~1300 utxos, UTXOList.update() took ~3.2 sec before this,
now it's ~0.8 sec.
given a bip21 uri that has both onchain addr and bolt11,
if we have LN enabled but no LN channels, auto-fallback to paying onchain
we will have to clean up and unify this logic between GUIs. becoming spaghetti :/
rumour has it, Thomas has a branch? :P
B023 Function definition does not bind loop variable 'already_selected_buckets_value_sum'
in keepkey/qt.py, looks like this was an actual bug
(fixed in trezor plugin already: 52a4810752 )
B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
B008 Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
Had a crash shortly after enabling lightning and the LN keys were lost...
Though note that opening a channel triggers wallet.save_db(), so I think
nothing of real value is at risk without this change.