1
0
Commit Graph

4623 Commits

Author SHA1 Message Date
ThomasV
e992e3a9b2 Qt: follow-up e362d1aac4 2022-04-20 13:42:06 +02:00
ThomasV
ba018c707f Qt: add bolt11_fallback and bip21_lightning options to preferences 2022-04-20 12:48:22 +02:00
ThomasV
cbb51b31d8 kivy updates 2022-04-20 12:48:22 +02:00
ThomasV
0c64a884c9 Qt: show single balance in statusbar
- details in popup dialop
  - piechart in status bar
2022-04-20 12:48:22 +02:00
ThomasV
60865f3902 Show options if we do not have the liquidity to pay a lightning invoice:
pay onchain, open channel, rebalance.

If we do a swap or open a channel, the payment will be scheduled.
2022-04-20 12:48:22 +02:00
ThomasV
2c6e36e89d Fallback addresses
- add fallback address to BOLT-11 LN invoices
   - Qt: if LN payment fails, propose onchain fallback
2022-04-20 12:48:22 +02:00
ThomasV
f18a042955 Qt: receive_lightning_help text 2022-04-20 12:48:22 +02:00
ThomasV
9ba5a34800 Qt receive tab:
- show payment options in tabs: URI, Address or Lightning
 - use vertical tabs to save space
 - switch between QR and text views
 - open standalone QR window through menu, instead of clicking on QR code
2022-04-20 12:48:22 +02:00
ThomasV
bf4455ef30 follow-up db invoice unification:
- fix command line
 - deprecate add_lightning_request
2022-04-20 12:48:22 +02:00
ThomasV
7102fb732e follow-up prev:
- detect payment of requests both onchain or LN
 - create single type of requests in GUI
2022-04-20 12:48:22 +02:00
ThomasV
e392197ab9 wallet_db upgrade:
- unify lightning and onchain invoices, with optional fields for bip70 and lightning
 - add receive_address fields to submarine swaps
2022-04-20 12:48:22 +02:00
SomberNight
8e234f3ccd qt gui: better detection of missing PyQt5 at startup
If I use apt on ubuntu to install python3-pyqt5 and then remove it, it leaves an empty namespace:
```
$ python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>> import PyQt5.QtGui
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5.QtGui'
>>> PyQt5
<module 'PyQt5' (namespace)>
```
2022-04-11 17:38:45 +02:00
SomberNight
3451140ce7 qt coins list: fix populating labels
follow-up e362d1aac4
2022-04-10 15:17:40 +02:00
ThomasV
5bd2524bfb follow-up #7748 2022-04-09 10:51:09 +02:00
ThomasV
877a9f553b Merge pull request #7748 from spesmilo/confirm_reverse_swaps
Confirm reverse swaps
2022-04-09 10:41:02 +02:00
ThomasV
3e6595ae98 Merge pull request #7756 from SomberNight/202204_qt_taskthread_cancel
qt taskthread cleaner shutdown
2022-04-09 10:38:06 +02:00
SomberNight
29c1106988 qt main_window: move TaskThread from wallet.thread to window.thread 2022-04-08 20:50:03 +02:00
SomberNight
428dff90f8 address_sync: include verifier in sync_state progress indicator 2022-04-08 20:36:45 +02:00
SomberNight
30650c524c address_sync: "up_to_date" now waits for SPV 2022-04-08 20:35:23 +02:00
SomberNight
a05ef140d6 address_sync: split off unconfirmed_tx from unverified_tx 2022-04-08 20:34:45 +02:00
SomberNight
837fc1606c address_sync: change up_to_date to be private; no lock needed to read
After some consideration I am fairly certain there is no need to take
wallet.lock in `is_up_to_date()`. Any caller that might want some kind
of guarantees re the value returned by is_up_to_date() would need to
enforce them itself by e.g. taking wallet.lock around its critical code
block. That is, even if is_up_to_date() itself takes the lock, between
the call returning and the caller reading the value there could still
have been a race.
Also, the GUI was directly accessing the field already.
2022-04-08 20:33:13 +02:00
SomberNight
214ac19f15 window.run_coroutine_from_thread: don't use wallet.thread
wallet.thread was serialising the fut.result() calls, so consider e.g.
- coro1 gets scheduled,
- wallet.thread waits on fut1.result()
- coro2 gets scheduled,
- coro2 finished with exception and wants to show an error popup,
-> wallet.thread is still waiting on fut1.result() before it looks at fut2.result
2022-04-07 20:20:30 +02:00
SomberNight
96c063028a qt TaskThread: implement cancellation of tasks, for cleaner shutdown
fixes https://github.com/spesmilo/electrum/issues/7750

Each task we schedule on `TaskThread` can provide an optional `cancel` method.
When stopping `TaskThread`, we call this `cancel` method on all tasks in the queue.
If the currently running task does not implement `cancel`, `TaskThread.stop` will block
until that task finishes.

Note that there is a significant change in behaviour here:
`ElectrumWindow.run_coroutine_from_thread` and `ElectrumWindow.pay_lightning_invoice`
previously serialised the execution of their coroutines via wallet.thread.
This is no longer the case: they will now schedule coroutines immediately.
So for example, the GUI now allows trying to pay multiple LN invoices "concurrently".
2022-04-07 19:51:58 +02:00
ThomasV
ad41f4aed0 trampoline legacy mpp: link to eclair issue 2022-04-07 19:50:30 +02:00
SomberNight
250795f137 verifier: small clean-up
this code runs in the interface's group, so it's confusing to call the network's methods
2022-04-04 20:55:47 +02:00
SomberNight
207600e00c transaction.py: TxOutpoint: nicer __str__ and __repr__
useful e.g. when TxOutpoint is used as key in a dict (and the dict is printed)
2022-04-01 21:31:50 +02:00
SomberNight
0226e7196d swaps: build index(es) for the swaps dict to avoid linear scanning 2022-04-01 21:30:41 +02:00
ThomasV
083205714c Qt: reorganize settings dialog 2022-04-01 20:20:04 +02:00
ThomasV
e362d1aac4 Qt: make display of lists more stable.
Use refresh_row() for address, utxo and contact lists.
Replace unneeded calls to update_tabs() with refresh_tabs()

Fix right-click menu after selecting multiple addresses.
2022-04-01 14:11:31 +02:00
ThomasV
f01197b6b5 Reverse swaps: Wait until funding tx is confirmed
- override with allow_instant_swaps option (Qt)
2022-04-01 14:05:01 +02:00
ThomasV
44d3b0bc61 Merge pull request #7724 from spesmilo/rbf_swap
bump fee of swap claim transactions
2022-04-01 13:56:05 +02:00
ThomasV
670f8dbe42 submarine_swaps: use prevout to determine if a txin is claiming a swap 2022-04-01 13:55:36 +02:00
ThomasV
1574e10869 follow-up 92c6d91157: remove paid item from request_list 2022-04-01 11:32:57 +02:00
SomberNight
7268fa55f2 config: abstract away mempool depth format str "%.1f MB from tip"
related: 4dd94172a6
(as that commit introduced depth targets that need more precision to display)
2022-03-31 22:50:31 +02:00
SomberNight
e36d7fed7d swaps: more precise tx size estimation for claim tx when RBF-ing 2022-03-31 20:55:11 +02:00
SomberNight
2b13576eb3 qt history tab: fix double-clicking inside collapsible items
Swaps (both reverse and forward) are displayed in the list as a tree, which can be
expanded/collapsed. When expanded, double-clicking on any of the children (regardless
of child being LN or onchain), was interacting with the incorrect item (the first few
items in the top-level list).

Consider `self.tx_item_from_proxy_row(idx.row())`.
`idx.row()` is probably a small int, e.g. `0`, and `tx_item_from_proxy_row` is just
getting that item from the top-level list.

Note that the right-click>"View ..." context menu behaves correctly, so prior to
this commit it was inconsistent with double-clicking.
2022-03-31 19:10:39 +02:00
SomberNight
357aaff582 swaps: when RBF-ing a forward swap tx, payment amt must not decrease 2022-03-30 19:01:57 +02:00
SomberNight
aa5172faa2 swaps: fix forward swap: lnworker.create_invoice is not async
follow-up cb39bbbd94
2022-03-30 17:42:12 +02:00
ThomasV
1364e7538a bump fee of swap claim transactions
Note: This adds a new field, spent_txid, to PartialTxOutput
2022-03-30 13:44:10 +02:00
SomberNight
4dd94172a6 config: fee slider: add more steps in mempool mode
closes https://github.com/spesmilo/electrum/issues/6474
2022-03-29 20:22:09 +02:00
SomberNight
68ba223ce1 qt ConfirmTxDialog: word-wrap error message text
e.g. this text:
"This transaction requires a higher fee, or it will not be propagated by your current server. Try to raise your transaction fee, or use a server with a lower relay fee."
is too long for a single line.
2022-03-29 20:15:52 +02:00
SomberNight
1810835fae lnchannel: get_capacity() should not raise when running with --offline
```
E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\channels_list.py", line 295, in do_update_rows
    field_map = self.format_fields(chan)
  File "...\electrum\electrum\gui\qt\channels_list.py", line 99, in format_fields
    capacity_str = self.parent.format_amount(chan.get_capacity(), whitespaces=True)
  File "...\electrum\electrum\lnchannel.py", line 481, in get_capacity
    return self.lnworker.lnwatcher.get_tx_delta(self.funding_outpoint.txid, self.cb.funding_address)
AttributeError: 'NoneType' object has no attribute 'get_tx_delta'
```
2022-03-29 18:30:55 +02:00
ThomasV
cb39bbbd94 lnworker: make calc_routing_hints_for_invoice and create_invoice non-async 2022-03-29 17:42:04 +02:00
SomberNight
ec98ef5aee hw ledger: sign_transaction: add progress indicator
related: https://github.com/spesmilo/electrum/issues/7516
2022-03-26 15:26:13 +01:00
SomberNight
69c5375cc5 prepare release 4.2.1 2022-03-24 15:59:14 +01:00
ThomasV
a15dac2b8c channel_establishment_flow: do not save wallet file backup in the background.
Instead, display a popup everytime, if the channel is not recoverable.
2022-03-24 14:55:45 +01:00
ThomasV
92c6d91157 Qt: on status changes, refresh item in invoice_list and request_list,
instead of calling update(), which repopulates the model.
2022-03-23 19:52:28 +01:00
ThomasV
d3476b6ba0 fix deadlock: self.lock should be taken before self.transaction_lock
(self.lock is taken in self.get_tx.height)
2022-03-23 19:27:49 +01:00
SomberNight
05649861c8 qt gui: more resilient startup: catch more exceptions, better fallback
fixes https://github.com/spesmilo/electrum/issues/7447

Consider this trace for 4.2.0:
```
Traceback (most recent call last):
  File "electrum/gui/qt/__init__.py", line 332, in start_new_window
  File "electrum/gui/qt/__init__.py", line 363, in _start_wizard_to_select_or_create_wallet
  File "electrum/gui/qt/installwizard.py", line 302, in select_storage
  File "electrum/util.py", line 504, in get_new_wallet_name
PermissionError: [Errno 1] Operation not permitted: '/Users/admin/Documents/Peach/MS'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "electrum/gui/qt/__init__.py", line 426, in main
  File "electrum/gui/qt/__init__.py", line 307, in wrapper
  File "electrum/gui/qt/__init__.py", line 349, in start_new_window
  File "electrum/util.py", line 504, in get_new_wallet_name
PermissionError: [Errno 1] Operation not permitted: '/Users/admin/Documents/Peach/MS'
```

Note that `get_new_wallet_name` (os.listdir) can raise OSError,
and we were calling that on the main entrypoint codepath without exception-handling.
We were also calling it in the fallback codepath without exception-handling.
i.e. the GUI errored out on every startup for affected users, and without CLI usage
it was not possible to recover.
2022-03-23 03:58:33 +01:00
SomberNight
25fee6a6be kivy: locale: set default language to English
This reverts 7cb11ceda4 (set default language to OS lang).
Some languages (e.g. CJK, Arabic) do not work at all with kivy due to font issues,
so we should never use those as default. It is easiest to just default to English for now.

related https://github.com/spesmilo/electrum/issues/2032
related https://github.com/spesmilo/electrum/issues/4618
related https://github.com/spesmilo/electrum/issues/7494
2022-03-22 17:20:33 +01:00