Handles exceptions thrown by `shutil.copyfile()` in the
`add_plugin_dialog`.
In issue #10101 an user tried to access an onedrive vault directory which
made shutil fail to copy the file with:
```
OSError: [Errno 22] Invalid argument: 'odopen://unlockvault/?accounttype=personal'
```
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).
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.
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.
Sets the [`RawDescriptionHelpFormatter`](https://docs.python.org/3/library/argparse.html#argparse.RawDescriptionHelpFormatter)
as `formatter_class` for the command parser. This makes argparse respect
the newlines in the command descriptions and showing them in the cli
with `-h` looks better by representing the same formatting as in source.
E.g. `serialize -h` before:
```
usage: run_electrum serialize [-h] jsontx
Create a signed raw transaction from a json tx template. Example value for "jsontx" arg: { "inputs": [ {"prevout_hash":
"9d221a69ca3997cbeaf5624d723e7dc5f829b1023078c177d37bdae95f37c539", "prevout_n": 1, "value_sats": 1000000, "privkey":
"p2wpkh:cVDXzzQg6RoCTfiKpe8MBvmm5d5cJc6JLuFApsFDKwWa6F5TVHpD"} ], "outputs": [ {"address": "tb1q4s8z6g5jqzllkgt8a4har94wl8tg0k9m8kv5zd", "value_sats":
990000} ] } :
positional arguments:
jsontx Transaction in json
options:
-h, --help show this help message and exit
Run 'electrum -h to see the list of global options
```
after this patch:
```
usage: run_electrum serialize [-h] jsontx
Create a signed raw transaction from a json tx template.
Example value for "jsontx" arg: {
"inputs": [
{"prevout_hash": "9d221a69ca3997cbeaf5624d723e7dc5f829b1023078c177d37bdae95f37c539", "prevout_n": 1,
"value_sats": 1000000, "privkey": "p2wpkh:cVDXzzQg6RoCTfiKpe8MBvmm5d5cJc6JLuFApsFDKwWa6F5TVHpD"}
],
"outputs": [
{"address": "tb1q4s8z6g5jqzllkgt8a4har94wl8tg0k9m8kv5zd", "value_sats": 990000}
]
}
:
positional arguments:
jsontx Transaction in json
options:
-h, --help show this help message and exit
Run 'electrum -h to see the list of global options
```
qml: add signals for QEQRScanner and fallbacks, add QEBytes container type
so we can pass along byte arrays between QML and python, port qr scan
occurrences to new signals.
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."
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.
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.
- 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
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>
Adds an on_done_callback to the QESwapHelper.transport_task future
to prevent the task from swallowing exceptions by retrieving exceptions
and calling `util.send_exception_to_crash_reporter` with them.
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).
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.
- 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)