1
0
Commit Graph

18397 Commits

Author SHA1 Message Date
accumulator
a7ce107f01 Merge pull request #9737 from f321x/fix_swap_pay_invoice
swaps: don't limit attempts when paying swap invoice
2025-04-28 21:50:23 +02:00
ThomasV
a511ab8e78 lnwatcher.maybe_extract_preimage: early return if tx is unsigned 2025-04-25 13:31:42 +02:00
accumulator
ea03c673e9 Merge pull request #9759 from accumulator/common_taskthread
qt,qml: move TaskThread to common_qt
2025-04-25 09:37:56 +02:00
accumulator
0839229222 Merge pull request #9763 from f321x/fix_9761
qt: fix OverlayControlMixin.add_menu_button type error, fix type hints
2025-04-24 10:13:14 +02:00
Sander van Grieken
ae906fb17c wallet: imports, whitespace, typing hints 2025-04-24 10:09:48 +02:00
f321x
ee8d53b96e fix OverlayControlMixin.add_menu_button type error, fix type hints 2025-04-24 09:32:29 +02:00
Sander van Grieken
41c0558595 exchange_rate: imports, type hints 2025-04-24 09:19:07 +02:00
Sander van Grieken
0ccdddf46a logging levels
lnpeer: received orphan channel update -> debug
exchange_rate: received quotes -> debug
2025-04-24 09:10:59 +02:00
Sander van Grieken
64a160027a imports, whitespace, type hints 2025-04-23 16:09:31 +02:00
Sander van Grieken
c89e8f6f03 qt,qml: move TaskThread to common_qt 2025-04-23 15:24:02 +02:00
Sander van Grieken
960e4ba583 android: update plugin exclude list 2025-04-23 14:50:22 +02:00
ThomasV
37f0f539c8 Qt: add message argument to get_password 2025-04-22 17:10:30 +02:00
ThomasV
c6a5f4f084 txbatcher: do not sweep anchor outputs if ctx has been mined 2025-04-22 16:39:38 +02:00
ThomasV
89346eda6c Merge pull request #9722 from f321x/enable_anchors_default
lightning: enable anchor channels by default
2025-04-22 14:32:21 +02:00
ThomasV
5bea2c6f6c TxBatcher: detect if base tx has been replaced.
Alow user to bump fee of txbatcher transaction from GUI
2025-04-22 14:12:05 +02:00
ThomasV
bcf60fffe3 relative timelocks: also check that nVersion >= 2 2025-04-22 13:28:05 +02:00
Oren
2fb0dd066f Timelock Recovery Extension (#9589)
* Timelock Recovery Extension

* Timelock Recovery Extension tests

* Use fee_policy instead of fee_est

Following 3f327eea07

* making tx with base_tx

Following ab14c3e138

* move plugin metadata from __init__.py to manifest.json

* removing json large indentation

* timelock recovery icon

* timelock recovery plugin: fix typos

* timelock recovery plugin: use menu instead of status bar.

The status bar should be used for displaying status. For example,
hardware wallet plugins use it because their connection status is
changing and needs to be displayed.

* timelock recovery plugin: ask for password only once

* timelock recovery plugin: ask whether to create cancellation tx in the initial window

* remove unnecessary code.

(calling run_hook from a plugin does not make sense)

* show alert and cancellation address at the end.

skip unnecessary dialog

* timelock recovery plugin: do not show transactions one by one.

Set the fee policy in the first dialog, and use the same fee
policy for all tx. We could add 3 sliders to this dialog, if
different fees are needed, but I think this really isn't
really necessary.

* simplify default_wallet for tests

All the lightning-related stuff is irrelevant for
this plugin.

Also use a different destination address
for the test recovery-plan (an address
that does not belong to the same wallet).

* Fee selection should be above fee calculation

also show fee calculation result with "fee: " label.

* hide Sign and Broadcast buttons during view

* recalculate cancellation transaction

The checkbox could be clicked after the fee rate
has been set. Calling update_transactions() may seem
inefficient, but it's the simplest way to avoid such edge-cases.

Also set the context's cancellation transaction to None when the
checkbox is unset.

* use context.cancellation_tx instead of checkbox value

context.cancellation_tx will be None iff the checkbox was unset

* hide cancellation address if not used

* init monospace font correctly

* timelock recovery plugin: add input info at signing time.

Fixes trezor exception: 'Missing previous tx'

* timelock recovery: remove unused parameters

* avoid saving the tx in a separate var

fixing the assertions

* avoid caching recovery & cancellation inputs

* timelock recovery: separate help window from agreement.

move agreement at the end of the flow, rephrase it

* do not cache alert_tx_outputs

* do not crash when not enough funds

not enough funds can happen
when multiple addresses are specified
in payto_e, with an amount larger
than the wallet has - so we set
the payto_e color to red.

It can also happen when the user
selects a really high fee, but this
is not common in a "recovery"
wallet with significant funds.

* If files not saved - ask before closing

* move the checkbox above the save buttons

people read the text from top to
bottom and may not understand
why the buttons are disabled

---------

Co-authored-by: f321x <f321x@tutamail.com>
Co-authored-by: ThomasV <thomasv@electrum.org>
2025-04-22 10:02:01 +02:00
ThomasV
c12eb31d88 qt main_window: add get_password utility function 2025-04-22 09:41:26 +02:00
ThomasV
8bb94dd57d follow-up previous commit 2025-04-22 09:41:17 +02:00
ThomasV
69f8176aab Qt: show relative locktime in tx details 2025-04-22 09:30:53 +02:00
ThomasV
22b3d78c9f txbatcher: fix add make_witness 2025-04-20 17:26:40 +02:00
SomberNight
5f83fffd2e swaps.py: (trivial) fix stale type-hint 2025-04-17 17:13:21 +00:00
ThomasV
3eac741947 Merge pull request #9739 from accumulator/psbt_nostr_fixes
plugins: psbt_nostr: start processing PSBTs after wallet is_up_to_date
2025-04-17 08:34:42 +02:00
ThomasV
5ee46b189c Merge pull request #9743 from f321x/fix_password_command
cmd: fix password command eval type
2025-04-17 08:26:22 +02:00
f321x
1e5187b9df fix password command eval type 2025-04-16 17:48:40 +02:00
ThomasV
c0ddce4586 plugins: rename plugin nostr cosigner, minor tweaks 2025-04-16 10:08:55 +02:00
Sander van Grieken
4e9ec5d2ea plugins: psbt_nostr: exclude 2FA wallets 2025-04-16 10:05:54 +02:00
Sander van Grieken
182accb9fb plugins: psbt_nostr: move can_send_psbt logic from GUI to backend, fix qml wallet switch bug 2025-04-16 09:47:41 +02:00
Sander van Grieken
eb52090fee plugins: psbt_nostr: start processing PSBTs after wallet is_up_to_date
also don't break the receive loop when an invalid tx is received.
2025-04-16 09:13:36 +02:00
ThomasV
9d42505eec psbt_nostr: add plugin icon to txdialog button 2025-04-15 18:23:58 +02:00
ThomasV
dff1d5b0c1 Merge pull request #9694 from accumulator/qml_psbt_over_nostr
psbt_nostr: split generic and UI parts, implement for qml
2025-04-15 18:12:17 +02:00
ThomasV
70ab4f2190 Fix password passed to daemon.load_wallet
The password should not be an empty string.

Traceback (most recent call last):
  File "/opt/electrum/electrum/gui/qt/__init__.py", line 377, in start_new_window
    wallet = self._start_wizard_to_select_or_create_wallet(path)
  File "/opt/electrum/electrum/gui/qt/__init__.py", line 446, in _start_wizard_to_select_or_create_wallet
    wallet = self.daemon.load_wallet(wallet_file, d['password'], upgrade=True)
  File "/opt/electrum/electrum/daemon.py", line 461, in func_wrapper
    return func(self, *args, **kwargs)
  File "/opt/electrum/electrum/daemon.py", line 474, in load_wallet
    wallet.unlock(password)
  File "/opt/electrum/electrum/wallet.py", line 3418, in unlock
    self.check_password(password)
  File "/opt/electrum/electrum/wallet.py", line 3069, in check_password
    raise InvalidPassword("password given but wallet has no password")
electrum.util.InvalidPassword: password given but wallet has no password
2025-04-15 18:01:25 +02:00
Sander van Grieken
3b97ab7407 plugins: psbt_nostr: qt: offer 3 choices for each PSBT; 'Open, Discard, Save to wallet' 2025-04-15 17:38:11 +02:00
f321x
6bdedb3ecd don't limit attempts when paying swap invoice 2025-04-15 15:53:31 +02:00
ThomasV
34a8ec64f8 move audio_modem icons to plugin dir, so that the plugin is self-contained.
This requires changing the API of OverlayControlMixin.addButton
2025-04-15 15:34:01 +02:00
Sander van Grieken
60bd6327ce plugins: psbt_nostr: let GUI handle a received PSBTs one by one by pausing receiving additional PSBTs until PSBT dialog is closed.
Accepting a PSBT opens the Tx dialog and pauses receiving additional PSBTs until the Tx dialog is closed.
Rejecting a PSBT will start a cooldown and accept all pending PSBTs into the history for later inspection.
2025-04-15 14:06:57 +02:00
Sander van Grieken
3ff84f08a6 plugins: psbt_nostr: implement for qml 2025-04-15 14:06:29 +02:00
Sander van Grieken
13a4076f22 plugins: psbt_nostr: split generic and UI parts 2025-04-15 14:00:36 +02:00
ThomasV
147b3fae1b Merge pull request #9725 from accumulator/qt_seedwidget_copy_button
qt: SeedWidget: for xpubs, show copy button next to QR button.
2025-04-15 12:27:08 +02:00
ThomasV
1162f45bd5 plugins: minor tweaks
- add icon to PluginDialog
 - add icon to psbt_nosr
 - rename 'PSBT Nostr' as 'Nostr Multisig'
2025-04-15 12:23:03 +02:00
Sander van Grieken
24d03340da qt: SeedWidget: for xpubs, show copy button next to QR button.
This is only used when displaying wallet xpub in wizard for multisig setup.
2025-04-15 11:00:39 +02:00
ThomasV
a92e65c561 plugins: add plugin icon to menu in init_menubar 2025-04-15 10:33:14 +02:00
ThomasV
dcf632ed1e add icons for nwc and labels plugins 2025-04-15 10:23:05 +02:00
ThomasV
0831fc3b80 plugins: move wallet-related settings to the wallet menu
Plugins should use the init_menubar hook.
References are kept to the various menu objects.
2025-04-15 10:01:00 +02:00
ThomasV
8c028f7528 Add/remove plugins from GUI
- both internal and external plugins require GUI install
   (except internal HW plugins, which are 'auto-loaded' and hidden)
 - remove init_qt hook
 - in Qt, reload wallet windows if plugin enabled/disabled
 - add 'uninstall' button to PluginDialog
 - add 'add plugins' button to wizard hw screen
 - add icons to the plugin list
2025-04-15 08:35:10 +02:00
SomberNight
d1e1ca7fd2 ci: fix "locale: upload to crowdin" task
follow-up https://github.com/spesmilo/electrum/pull/9726
2025-04-14 18:08:31 +00:00
ghost43
02a005d533 Merge pull request #9733 from f321x/fix_too_large_onion_payload
lightning: stop including all invoice r_tags in legacy trampoline onion
2025-04-14 17:45:26 +00:00
ghost43
3d3933afdb Merge pull request #9726 from SomberNight/202504_locale
mv git submodule electrum-locale from contrib to electrum/locale
2025-04-14 17:20:41 +00:00
f321x
8d79c58c5e Stop including all invoice r_tags in legacy trampoline onion
This change modifies create_trampoline_onion to only include as many
available r_tags as there is space left in the trampoline onion payload.

Previously we tried to include all passed invoice r_tags of legacy
trampoline payments into the payload which caused an user facing
exception and payment failure as the onion can only store a max of 400
bytes.
A single, single hop r_tag is around 52 bytes and the payload
without r_tags is already at ~280 bytes. So usually there is enough
space for 2 r_tags.
The implementation shuffles the r_tags on each call
so the payment will try different route hints on the attempts (fee level
increase or user retry).

I have logged the following byte sizes of the trampoline onion with a 2
trampoline onion hop and changing amounts of r_tags:

3 rtags:
payload size [0]: 113 (hop size: 81)
payload size [1]: 440 (hop size: 295) ( 52 bytes/rtag )
payload size [2]: 550 (hop size: 78)

2 rtags:
payload size [0]: 113 (hop size: 81)
payload size [1]: 386 (hop size: 241) ( 52 bytes/rtag )
payload size [2]: 496 (hop size: 78)

1 rtag:
payload size [0]: 113 (hop size: 81)
payload size [1]: 334 (hop size: 189) ( 52 bytes/rtag )
payload size [2]: 444 (hop size: 78)

0 rtags:
payload size [0]: 113 (hop size: 81)
payload size [1]: 282 (hop size: 137)
payload size [2]: 392 (hop size: 78)

As can be seen in the data, using 2 trampoline hops there is not enough
space for even a single r_tag which is why this option is being removed
too.
2025-04-14 19:20:11 +02:00
SomberNight
950658183c contrib: push_locale.py: fix relative paths in messages_qml.pot
The Qt lupdate tool that extracts translatable strings from .qml files
writes paths relative to its output .ts file into the .ts file.
These paths are then retained as-is when converted to .pot format.

The last few commits moved around the working directory of the lupdate tool
(from electrum/locale to electrum/locale/build), which resulted in a change
of all relative paths in the final messages.pot we upload to crowdin.

E.g. from:
```
#: ../gui/qml/components/Addresses.qml:64
```
to:
```
#: ../../gui/qml/components/Addresses.qml:64
```

I think a change like this does not invalidate the translations. Still, it is annoying.

This commit adds an extra processing step to "fix" these strings to:
```
#: electrum/gui/qml/components/Addresses.qml:64
```
2025-04-14 17:18:40 +00:00