1
0
Commit Graph

19040 Commits

Author SHA1 Message Date
ghost43
52bb41a73e Merge pull request #10091 from f321x/reserve_input_check_make_unsigned_transaction
wallet: don't spend reserve utxo to create new reserve utxo
2025-07-30 12:27:58 +00:00
f321x
23a48e7cfd test: add unittest for not spending ln reserve utxo
adds unittest to `test_wallet_vertical.py` to verify it is not using the
existing ln reserve utxo as tx input if a reserve is still required (in
opposite to using it as input and creating a new reserve as output).
2025-07-30 10:12:34 +02:00
ghost43
4a288cf2d5 Merge pull request #10090 from SomberNight/202507_android_chain_hack
android: extend testnet package name hack to other chains
2025-07-29 18:22:46 +00:00
f321x
30b146033d gui: detect if reserve inputs have been removed from tx
Adapts the gui(s) to detect if an existing reserve input has not been
used as input for the transaction even though the user tried to spend
max. This allows to show the lightning reserve warning not only for
reserve change outputs but also for existing reserve inputs that have
been ignored for this max spend transaction.
Still keeps the `is_utxo_reserve` flag on `PartialTxOutput` as it is
used in the qml gui.
2025-07-29 15:40:51 +02:00
f321x
ead2c7c8de wallet: don't add reserve input if reserve utxo exists
Right now if a ln reserve is required and there is already a reserve
sized utxo available, `make_unsigned_transaction()` will still add the
reserve as input to a 'spend max' transaction and add a reserve change
output. This seems wasteful, this patch instead just removes the input
so it is not spent at all.
2025-07-29 15:35:55 +02:00
SomberNight
3ae9cad36d android: extend testnet package name hack to other chains
closes https://github.com/spesmilo/electrum/issues/10087
2025-07-29 12:18:42 +00:00
accumulator
4a370af64a Merge pull request #10088 from oren-z0/timelock-recovery-extension-typo
Fix typo
2025-07-28 13:49:38 +02:00
Oren
9487589e06 Fix typo
website is mempoi.space, not
mempool.space.com
2025-07-27 12:12:39 +03:00
Sander van Grieken
146a5438ff qml: guard against wallet.network is None, QEWallet timer can trigger this func
while wallet is closing (when app is closing)
2025-07-25 09:13:26 +02:00
accumulator
5e00c55a06 Merge pull request #10080 from f321x/fix_setDesktopFilename_warning
fix: remove .desktop from setDesktopFileName argument
2025-07-24 12:36:07 +02:00
f321x
c7e3fec69e fix: remove .desktop from setDesktopFileName argument
Removes the '.desktop' suffix from the
`QGuiApplication.setDesktopFileName` argument to prevent the following
warning on startup of Electrum:
```
QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop.
For compatibility reasons, the .desktop suffix will be removed.
Please specify a desktop file name without .desktop suffix
```

The [qt
docs](https://doc.qt.io/qtforpython-6/PySide6/QtGui/QGuiApplication.html#PySide6.QtGui.QGuiApplication.desktopFileName)
say that `desktopFileName` is "... is the file name, without the full
path or the trailing “.desktop” extension of the desktop entry that
represents this application according to the freedesktop desktop entry
specification."
2025-07-24 10:26:42 +02:00
accumulator
da18c975a2 Merge pull request #10072 from accumulator/android_qr_scanner_lifecycle
android: don't keep adding BarcodeScannerView instances to contentFrame when starting camera
2025-07-23 10:21:51 +02:00
ghost43
7fdbb0b4e0 Merge pull request #10074 from f321x/fix_ci_pip
fix failing pip installs in regtest CI
2025-07-22 19:11:35 +00:00
f321x
ac2666ef9e fix failing pip installs in regtest CI
It seems like the OS version of the CI image has been bumped, the regtest of PR https://github.com/spesmilo/electrum/pull/10073 fails for me with this error:

```
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 111702 files and directories currently installed.)
Preparing to unpack .../jq_1.7.1-3ubuntu0.24.04.1_amd64.deb ...
Unpacking jq (1.7.1-3ubuntu0.24.04.1) over (1.7.1-3build1) ...
Preparing to unpack .../libjq1_1.7.1-3ubuntu0.24.04.1_amd64.deb ...
Unpacking libjq1:amd64 (1.7.1-3ubuntu0.24.04.1) over (1.7.1-3build1) ...
Setting up libjq1:amd64 (1.7.1-3ubuntu0.24.04.1) ...
Setting up jq (1.7.1-3ubuntu0.24.04.1) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.5) ...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
python3 -m pip install --user --upgrade pip
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
```

This should make the pip installs work again, however not sure how to test it *on* the CI? i it locally and it seems to work on Ubuntu 24.04 with this patch.
2025-07-22 20:04:31 +02:00
Sander van Grieken
3947733d9f android: don't keep adding BarcodeScannerView instances to contentFrame when starting camera
When putting app to background with qr scanner active, then moved to foreground again,
SimpleScannerActivity instance is not destroyed, but the local mScannerView was re-initialized
with a new instance (through startCamera()) regardless of pre-existing instance, and added to
the contentFrame. This leaves the previous mScannerView instance in limbo, potentially getting
garbage collected at unpredictable times.
2025-07-22 10:16:02 +02:00
ghost43
8eb3c43603 Merge pull request #10059 from f321x/fix_issue_10057
fix: cli: check_hold_invoice showing settled invoice as unpaid
2025-07-21 15:53:54 +00:00
ghost43
a391c3661c Merge pull request #10066 from f321x/fix_make_barcode_scanner_log_vars
fix: log correct var in make_barcode_scanner script
2025-07-21 14:38:48 +00:00
f321x
5298e29a36 fix: log correct var in make_barcode_scanner script
Fixes two log lines to use the correct path variable.
2025-07-21 16:28:00 +02:00
ghost43
43ae7e6df8 Merge pull request #10052 from SomberNight/202507_qt_crash_felix_2
crash reporter: rm `Never`, add confirm to `Send`, and only show window once per exc group
2025-07-21 13:50:35 +00:00
SomberNight
729003e557 wizard: move hw_unlock to base cls, and add test_wizard unlock_hw test 2025-07-21 03:33:43 +00:00
SomberNight
b0464cc934 refactor 'init_wallet_wizard' hook a bit. add test_wizard trezor test 2025-07-21 02:40:17 +00:00
SomberNight
358728b316 qt wizard: don't log xpub of hw cosigner 2025-07-21 02:21:40 +00:00
SomberNight
7675182a34 tests: test_wizard: dedupe wallet_name 2025-07-21 00:29:56 +00:00
SomberNight
a4c8cf2e4f tests: test_wizard: add 2fa_haveseed_disable2FA case 2025-07-21 00:18:40 +00:00
SomberNight
e0d67524a1 tests: test_wizard: set wallet password and yes/no encrypt file 2025-07-21 00:07:23 +00:00
SomberNight
05d9aca8aa test_wizard: now that I ctrl+c, ctrl+v-ed lots of code, patterns emerge 2025-07-20 23:43:24 +00:00
SomberNight
2bb7500e29 test: test_wizard: add 2fa_createseed case 2025-07-20 23:34:57 +00:00
SomberNight
a3dde40c69 test: test_wizard: add "old" electrum seed tests, and bip39+seed_ext 2025-07-20 23:26:09 +00:00
SomberNight
522810d5bd test: test_wizard: duplicate test_2fa, one for passphrase, one without 2025-07-20 22:24:06 +00:00
SomberNight
bfd3c0e48c Merge branch spesmilo/pr/10016' into 202507_pr10016_qml_wizard_passphrase 2025-07-20 22:02:01 +00:00
SomberNight
e56bc4f2ae tests: test_wizard: add final check: try loading created wallet file 2025-07-20 21:41:44 +00:00
SomberNight
01a1eacdb9 rework electrum-env script
- remove all PYTHONPATH-mangling as it keeps subtly not working on different systems
  - its main usecase was to use the apt installed pyqt, but I don't think that's worth the hassle
- instead now all dependencies are installed in the venv via pip
  - well, except for libsecp
- instead of installing unversioned latest deps at venv-creation-time, and then keep using those forever
  - the script now installs pinned deps, and detects updates to the pins and installs them again if they changed

closes https://github.com/spesmilo/electrum/pull/10018
2025-07-20 16:53:38 +00:00
Felix
b4de29e692 Add invoice_amount_sat to check_hold_invoice response
Adds an additional value to the `check_hold_invoice` cli command: `invoice_amount_sat` which returns the requested amount value of the hold invoice.

Co-authored-by: ghost43 <somber.night@protonmail.com>
2025-07-20 18:14:59 +02:00
ghost43
4616d4f135 Merge pull request #10060 from f321x/fix_issue_10053
qt: NewChannelDialog: do some validation before enabling Ok button
2025-07-20 16:03:30 +00:00
f321x
225ff4aba6 qt: NewChannelDialog: do some pre-validation for Ok button
Do some validation if the user input in `NewChannelDialog` before
allowing to click the `Ok` button. This is done to make the UI a bit
more intuitive and prevent issues like #10053 in which the user was able
to click `Ok` with a empty trampoline node list which raised an
`IndexError` (probably on testnet4).
2025-07-20 15:09:38 +02:00
f321x
8f9951ebed fix: cli: check_hold_invoice showing settled invoice as unpaid
the cli command `check_hold_invoice` incorrectly assumes that
`lnworker.is_accepted_mpp(payment_hash)` is true for settled invoices,
however it is not as the received mpp entries will be removed from
the `lnworker.received_mpp_htlcs` shortly after adding the preimage to
lnworker (after the htlcs got removed from the channel).

Also renames `amount_sat` in the `check_hold_invoice` response to
`amount_sat_received` to make it more obvious that this is the currently
received amount instead of the amount the invoice of `payment_hash` has
been created with.
2025-07-20 13:23:06 +02:00
SomberNight
ba07ca3ab9 config: add description to LIGHTNING_LISTEN configvar 2025-07-19 22:34:15 +00:00
SomberNight
c85272b546 crash reporter: only show reporter once per exception groupid
- don't show crash reporter multiple times for the "same" exception
  - at least until the user restart the program (there is no persistence)
- this is a ~replacement for the removed "Never show crash reporter" option
- in case there e.g. a thread with timer spamming an exception erroneously,
  this ensures we only offer to send the crash report once (per process lifecycle)
2025-07-18 16:44:15 +00:00
SomberNight
0e0e47c3c5 base_crash_reporter: change get_traceback_info to classmethod 2025-07-18 16:44:12 +00:00
SomberNight
970f84151d crash reporter: remove "Never" btn and config.SHOW_CRASH_REPORTER opt
- always hook into sys.excepthook and show the crash reporter
- if we don't hook into sys.excepthook and an exception propagates out on a Qt thread,
  that kills the Qt GUI
  - ref https://github.com/spesmilo/electrum/pull/10049#issuecomment-3089278083
2025-07-18 16:44:08 +00:00
SomberNight
2ed691b8f0 crash reporter: add popup asking to confirm to send_report 2025-07-18 16:44:05 +00:00
SomberNight
627f5a88b3 qml: ExceptionDialog: feedback from sendReport needs even higher z
follow-up 1559129016
2025-07-18 15:26:08 +00:00
SomberNight
eef562389c qml: qenetwork: fix type confusion for "server"
exc triggered when switching from same server to same server:
```
  9.43 | D | gui.qml.qenetwork | server_status updated: Connecting
  9.43 | E | network | Exception in _run_new_interface: Exception('diagnostic name not yet available?')
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/logging.py", line 241, in __get_logger_for_obj
    diag_name = self.diagnostic_name()
  File "/home/user/wspace/electrum/electrum/interface.py", line 555, in diagnostic_name
    return self.server.net_addr_str()
AttributeError: 'str' object has no attribute 'net_addr_str'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 1218, in wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/network.py", line 986, in _run_new_interface
    interface = Interface(network=self, server=server)
  File "/home/user/wspace/electrum/electrum/interface.py", line 502, in __init__
    Logger.__init__(self)
  File "/home/user/wspace/electrum/electrum/logging.py", line 232, in __init__
    self.logger = self.__get_logger_for_obj()
  File "/home/user/wspace/electrum/electrum/logging.py", line 243, in __get_logger_for_obj
    raise Exception("diagnostic name not yet available?") from e
Exception: diagnostic name not yet available?
```
2025-07-18 14:16:30 +00:00
ghost43
159d83905b Merge pull request #10049 from f321x/fix_show_transaction_user_cancelled
fix: handle UserCancelled in show_transaction
2025-07-18 12:06:02 +00:00
ghost43
ba68fb6e12 Merge pull request #10048 from f321x/fix_new_channel_exception
fix: qt: exception when clicking "New Channel"
2025-07-18 11:53:29 +00:00
SomberNight
463e447439 wallet.can_have_lightning: more explicit impl
Watching-only wallets can have a keystore.
It was actually keystore.may_have_password() that was filtering them out but that was not really obvious.
Better to be explicit I think.
2025-07-18 11:49:50 +00:00
ghost43
6feba10170 Merge pull request #10045 from f321x/fix_swap_update_relays
fix: NostrTransport.update_relays() KeyError
2025-07-18 11:29:05 +00:00
f321x
39bcdec584 fix: handle UserCancelled in show_transaction
`TxDialog` may has to fetch tx information from the network on
construction (`self.set_tx()`) and is showing a `RunCoroutineDialog`.
If the user cancels this dialog the `UserCancelled` exception is not
caught in `show_transaction()` and can even lead to Electrum crashing.
Fixes #10041
2025-07-18 13:14:27 +02:00
f321x
1b325394ba fix: exception when clicking "New Channel"
Fixes exception occuring when `wallet.lnworker` is `None` and the user
clicks on `New Channel` in the channels list tab. The `New Channel`
button is enabled when the wallet *can* have lightning, not the wallet
actually having lightning enabled.
With this patch the `init_lightning_dialog` will show up if the user
clicks on `New Channel` but lightning is not yet enabled.
I noticed this by restoring from a funded vpub and then
loading the keystore from seed afterwards.
2025-07-18 11:12:25 +02:00
f321x
dd41e87295 fix: NostrTransport.update_relays() KeyError
`NostrTransport.update_relays()` raises a `KeyError` when the offer of
the configured swapserver (`config.SWAPSERVER_NPUB`) is not in
`self._offers` even though `sm.pairs_updated` gets triggered. This
happens because `NostrTransport.get_pairs()` called `sm.update_pairs()`
before adding the received offer to `self._offers`.
2025-07-18 10:17:12 +02:00