The app hangs indefinitely if we try to quit it while one of
these threads is active, because once asyncio has shut down,
futures never return. This was already fixed for lightning
payments in c5dc133, but there are many other cases.
- they are now distinguished from local by the status text "in %d blocks"
- this status text needs updating occasionally: on new blocks,
and some lnwatcher interactions, hence new event: "adb_set_future_tx"
```
3.96 | E | gui.kivy.uix.dialogs.crash_reporter.ExceptionHook | exception caught by crash reporter
Traceback (most recent call last):
File "kivy/_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 1045, in update_wallet
self.update_tabs()
File "/home/user/wspace/electrum/electrum/util.py", line 462, in <lambda>
return lambda *args, **kw_args: do_profile(args, kw_args)
File "/home/user/wspace/electrum/electrum/util.py", line 458, in do_profile
o = func(*args, **kw_args)
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 506, in update_tabs
self.update_tab(name)
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 501, in update_tab
s.update()
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 161, in update
history_card.data = [self.get_card(item) for item in history]
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 161, in <listcomp>
history_card.data = [self.get_card(item) for item in history]
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 132, in get_card
status, status_str = self.app.wallet.get_tx_status(tx_hash, tx_mined_info)
File "/home/user/wspace/electrum/electrum/wallet.py", line 1491, in get_tx_status
num_blocks_remainining = tx_mined_info.wanted_height - self.adb.get_local_height()
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
```
QEInvoice/QEInvoiceParser now properly split for mapping to Invoice type (QEInvoice)
and parsing/resolving of payment identifiers (QEInvoiceParser).
additionally, old, unused QEUserEnteredPayment was removed.
invoices are now never saved with user-entered amount if the original invoice
did not specify an amount (e.g. address-only, no-amount bip21 uri, or no-amount
lightning invoice). Furthermore, QEInvoice now adds an isSaved property so the
UI doesn't need to infer that from the existence of the invoice key.
Payments of lightning invoices are now triggered through QEInvoice.pay_lightning_invoice(),
using the internally kept Invoice instance. This replaces the old call path of
QEWallet.pay_lightning_invoice(invoice_key) which required the invoice to be saved
in the backend wallet before payment.
The LNURLpay flow arriving on InvoiceDialog implicitly triggered payment, this is
now indicated by InvoiceDialog.payImmediately property instead of inferrred from the
QEInvoiceParser isLnurlPay property.
This is better than nothing, but not ideal. This window should
have a general purpose 'userinfo' field, like InvoiceDialog,
that would also display 'Broadcasting...' while the tx is being
broadcast.
Note that in order to bump the fee again, the user will have to
leave this window and open it again.