Commit Graph

16115 Commits

Author SHA1 Message Date
Sander van Grieken 8f3f282b62 Revert "qml: haptic override global setting"
This reverts commit 3e4737d6e9.
2023-04-05 12:08:54 +02:00
ThomasV 80a16e1377 fix typo (the error was silent) 2023-04-05 11:50:54 +02:00
Sander van Grieken 3e4737d6e9 qml: haptic override global setting 2023-04-05 11:38:38 +02:00
SomberNight db4943ff86 wallet.get_full_history: more consistent sort order
before:
```
>>> [print(wallet.get_tx_status(txid, wallet.adb.get_tx_height(txid))) for txid in list(wallet.get_full_history())[-10:]]
(7, '2023-04-04 16:13')
(7, '2023-04-04 16:13')
(7, '2023-04-04 16:13')
(7, '2023-04-04 16:13')
(0, 'Unconfirmed [20. sat/b, 0.00 MB]')
(2, 'in 2 blocks')
(3, 'Local [180.4 sat/b]')
(3, 'Local [180.2 sat/b]')
(2, 'in 2016 blocks')
(0, 'Unconfirmed [180. sat/b, 0.00 MB]')
```

after:
```
>>> [print(wallet.get_tx_status(txid, wallet.adb.get_tx_height(txid))) for txid in list(wallet.get_full_history())[-10:]]
(7, '2023-04-04 16:13')
(7, '2023-04-04 16:13')
(7, '2023-04-04 16:13')
(7, '2023-04-04 16:13')
(0, 'Unconfirmed [20. sat/b, 0.00 MB]')
(0, 'Unconfirmed [180. sat/b, 0.00 MB]')
(2, 'in 2016 blocks')
(2, 'in 2 blocks')
(3, 'Local [180.4 sat/b]')
(3, 'Local [180.2 sat/b]')
```
2023-04-04 18:32:53 +00:00
SomberNight f0e89b3ef6 addr_sync: migrate usages of get_txpos to get_tx_height
the return value of get_txpos is fine-tuned for sorting... other uses are highly questionable.
2023-04-04 17:49:46 +00:00
SomberNight f8f0af4a2f qml: history: add some support for future txs
- 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"
2023-04-04 17:39:58 +00:00
SomberNight 76f795bc9a kivy: history screen: fix "future" txs
```
  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'
```
2023-04-04 17:39:55 +00:00
ThomasV f04e2e2e6f Add an extra state for invoices where our tx has been broadcast
successfully, but it is not in our history yet.

(follow-up 159646fe54)
2023-04-04 19:31:25 +02:00
ThomasV 159646fe54 Set status of onchain invoices to PR_INFLIGHT while tx is being broadcast 2023-04-04 18:22:30 +02:00
Sander van Grieken cf3613b7d5 qml: handle max too 2023-04-04 17:59:40 +02:00
Sander van Grieken 793cbd1c6e qml: save with user entered amount 2023-04-04 17:47:37 +02:00
Sander van Grieken 6c65161d27 qml: refactor qeinvoice.py
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.
2023-04-04 16:13:00 +02:00
SomberNight 5d0d07c2b3 qml: QEWallet.broadcast: bring error msgs in line with qt 2023-04-04 14:02:54 +00:00
SomberNight 9097d5e43d addr_sync.set_future_tx: clarify wanted_height off-by-one semantics 2023-04-04 13:55:12 +00:00
SomberNight 446879ade0 lnwatcher.maybe_redeem: wanted_height should always be absolute
previously, if prev_height.height was <= 0, lnwatcher was calling adb.set_future_tx()
with weird wanted_height values (with ~sweep_info.csv_delay)
2023-04-04 13:37:10 +00:00
Sander van Grieken 2f9ecf3311 qml: combine Connections on same target 2023-04-04 13:22:58 +02:00
ThomasV 8e3a3cefcf qt: do not mutate already saved invoice after editing amount.
Also show empty an string for invoices that do not have an amount,
similar to the requests list.
2023-04-04 11:21:26 +02:00
ThomasV 479f952c9d follow-up ba2faa8. fixes #8294 2023-04-04 10:23:30 +02:00
ThomasV ebdebd18b4 qml: fix type hints in qeinvoicelistmodel 2023-04-04 10:21:56 +02:00
3rd Iteration 83ee260ab7 Add Device IDs for DIY Jade on M5StickC-Plus (#8291) 2023-04-04 09:27:38 +02:00
ThomasV 157954d4ff qml: do not block access to BalanceSummary if we are not connected. Display warning instead 2023-04-03 17:10:52 +02:00
Sander van Grieken 8bb2464acd qml: add haptic feedback for android. Also preload most used classes to reduce
lag on first use.
2023-04-03 16:07:15 +02:00
Sander van Grieken e362ac52fa qml: styling 2023-04-03 14:01:59 +02:00
Sander van Grieken 01c31edae2 qml: force same auto-capitalizing behavior on PasswordField regardless of echoMode 2023-04-03 13:31:20 +02:00
Sander van Grieken ba2faa8c9f qml: avoid adding duplicate request/invoice to listmodel 2023-04-03 12:11:32 +02:00
Sander van Grieken 86711a6a99 qml: icon 2023-04-03 12:07:47 +02:00
Sander van Grieken 0ce3559d62 qml: trustedcoin icon in 2fas wizard disclaimer 2023-04-03 10:59:50 +02:00
Sander van Grieken ffac79c324 qml: follupup prev 2023-04-03 10:27:33 +02:00
Sander van Grieken 4c87773174 qml: move user_knowns_press_and_hold to config 2023-04-03 10:26:03 +02:00
ThomasV 198ca10cd0 qml: add InfoTextArea about PressAndHold 2023-04-02 11:15:28 +02:00
ThomasV 03fbf6c3d8 qml: show lightning can send/receive amounts in balance details,
rather than in requestDetaildDialog.

Also remove junk code copy-pasted from WalletDetails.
2023-04-02 10:40:57 +02:00
ThomasV 545ee24f46 Qt: move new_channel_dialog to main_window and test available amount beforehand 2023-04-02 10:07:34 +02:00
ThomasV da802d20ad qml: make zero balance visible in balance details. Disable open channel button if there is no confirmed balance 2023-04-02 09:33:32 +02:00
ThomasV 84cb210e7e qml TxDetails: do not show rbf buttons if the tx is local 2023-04-01 17:11:15 +02:00
ThomasV 9eb59fc360 follow-up 56e685f: amount_sat may be None or max 2023-04-01 16:10:49 +02:00
ThomasV d0947bc0a6 follow-up 48689ecc89 2023-04-01 15:47:32 +02:00
ThomasV 48689ecc89 qml tx details and rbf dialogs: use a single InfoTextArea, to the
top of each dialog.

Do not display 'cannot bump fee' as the first thing we see when we
enter the bump fee dialog; suggest to move the slider instead.
2023-04-01 15:10:44 +02:00
ThomasV ba82813c06 qml InvoiceDialog: remove delete button, it only makes sense if you visit the list 2023-04-01 14:05:58 +02:00
ThomasV 02f093c2d2 qml SwapDialog: move userinfo to the top, make it constant, add padding and labels below the slider 2023-04-01 13:46:46 +02:00
ThomasV a753f34c09 Qt: rename utxo menu action to 'privacy analysis' 2023-04-01 12:47:30 +02:00
ThomasV 6d876da1c4 qml InvoiceDialog: update userinfo messages 2023-04-01 12:46:16 +02:00
ThomasV d6cbaaa2e9 qml InvoiceDialog: show invoice type in the title, fallback address in the details 2023-04-01 12:26:46 +02:00
ThomasV ad18298878 qml: Give user feedback after bumping the fee.
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.
2023-04-01 12:10:35 +02:00
ThomasV f396d15146 qml: (clarity) use separate slots for sign and sign_and_broadcast. 2023-04-01 12:03:50 +02:00
ThomasV 54bb42f82c adb: take locks in get_balance. fixes #8200 2023-04-01 10:37:38 +02:00
ThomasV fb47346ed3 follow-up 2cbb16ae4b. fixes #8290 2023-04-01 09:43:52 +02:00
SomberNight fc6cbb39ea qml: QEConfig.formatMilliSats to use config.format_amount 2023-03-31 22:17:53 +00:00
ThomasV 986955a6e8 qml: allow user to delete invoices and requests from the list screen
also, delete expired requests before loading list
2023-03-31 20:00:29 +02:00
ThomasV d4aeeaf541 follow-up c98b9e8d7b
(unintended deletion)
2023-03-31 18:36:45 +02:00
SomberNight 0e5464ca13 android build: enable asserts, and add sanity-check for it
Note that 0f541be6f1 added a warning log if asserts are disabled.
It is intentional that these two things are in separate files:
We always want to log that warning, even if someone is using electrum as a library.
However, in that latter case, I think it's fine not to sys.exit(), but leave the decision up to the library user.

Similar thinking when running from source: let's log the warning but don't sys.exit().
2023-03-31 16:24:14 +00:00