1
0
Commit Graph

19084 Commits

Author SHA1 Message Date
SomberNight
4f1cc8b9cb tests: set low wallet.gap_limit_for_change to speed up tests 2025-08-08 16:36:39 +00:00
SomberNight
4800a2d9c6 wallet: follow-up prev: always set wallet.gap_limit_for_change
even for Imported_Wallet
2025-08-08 16:36:32 +00:00
Filiprogrammer
3e8af98145 wallet: make gap limit for change configurable
Add the ability to configure the gap limit for change addresses while
retaining that value in the wallet database.

----

extracted from https://github.com/spesmilo/electrum/pull/8726

Co-authored-by: SomberNight <somber.night@protonmail.com>
2025-08-08 16:36:27 +00:00
SomberNight
302ee2444b wallet: refactor get_change_addresses_for_new_transaction 2025-08-08 15:30:33 +00:00
SomberNight
d6c300ebcc deps: bump libsecp256k1 version (0.6.0->0.7.0) and electrum-ecc 2025-08-07 13:24:41 +00:00
Sander van Grieken
f1c6798710 qt: wizard: xpub can be None, fixes #10109 2025-08-07 09:19:54 +02:00
Sander van Grieken
f79172c04f qml: sweep: handle network errors gracefully
fixes #10108
2025-08-06 11:02:58 +02:00
SomberNight
01694a363b contrib/release.sh: add small comment re git tags 4.6.1 2025-08-05 14:02:23 +00:00
SomberNight
8d83453d75 appimage build: fix dead link for appimagetool
they really want us to merge the migration to the new tool :D
https://github.com/spesmilo/electrum/pull/10019
2025-08-05 14:00:23 +00:00
SomberNight
0c831393ef prepare release 4.6.1 2025-08-05 13:21:19 +00:00
SomberNight
141848c6c3 update locale 2025-08-05 12:36:55 +00:00
ghost43
825f3f152b Merge pull request #10106 from SomberNight/202508_wallet_delete_address
wallet: more locking in delete_address
2025-08-04 16:01:14 +00:00
SomberNight
608980c050 wallet: more locking in delete_address
in particular, the "Cannot delete last remaining address from wallet" check should run
inside the lock

- tangentially related: https://github.com/spesmilo/electrum/issues/10104#issuecomment-3151165340
2025-08-04 15:14:10 +00:00
ghost43
ebb38e9fbd Merge pull request #10015 from SomberNight/202507_logging_only_once
logging: add "only_once=False" param to logger.info/warning/etc calls
2025-08-04 14:17:36 +00:00
Sander van Grieken
1695948874 wallet: type hints 2025-08-04 13:44:05 +02:00
Sander van Grieken
9b1566705d qml: swap: disable choose provider button during active swap. 2025-08-04 12:56:46 +02:00
ThomasV
6cf663a9b0 Merge pull request #10103 from f321x/handle_shutil_copyfile_exception
qt: handle shutil.copyfail exc in add_plugin_dialog
2025-08-04 11:30:46 +02:00
f321x
050b5b8076 qt: handle shutil.copyfail exc in add_plugin_dialog
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'
```
2025-08-04 09:50:15 +02:00
ghost43
4684cdbd17 Merge pull request #10067 from f321x/max_cltv_lnpay
cli: add max_cltv, max_fee_msat parameters to lnpay
2025-08-01 15:14:44 +00:00
SomberNight
6ddc975a94 follow-up prev: clean-up PaymentFeeBudget API 2025-08-01 15:06:33 +00:00
SomberNight
60eb437f99 tests: commands: fix assertRaises in test_hold_invoice_commands 2025-08-01 14:41:28 +00:00
ghost43
c23cc29caa Merge pull request #10082 from f321x/check_hold_invoice_show_htlc_cltv
cli: return closest htlc expiry from check_hold_invoice
2025-08-01 14:29:24 +00:00
f321x
23fa50df88 cli: add max_cltv and max_fee_msat parameter to lnpay
Adds `max_cltv` and `max_fee_msat` parameters to the `lnpay` cli command which allow to
specify the maximum total locktime of the payment and the maximum
absolute fee budget. This is enabled by
constructing a custom `PaymentFeeBudget` object in the lnpay command and
passing it as argument to `LNWallet.pay_invoice()`.
Allowing to specify a `max_cltv` value can be useful for certain
usecases, e.g. see https://github.com/spesmilo/electrum/issues/10056.

Closes #10056
2025-08-01 16:22:51 +02:00
ghost43
90f66b7700 Merge pull request #10095 from SomberNight/202507_sorted_nets_list
constants: NETS_LIST to have deterministic ordering
2025-08-01 13:39:26 +00:00
accumulator
8e5f29e890 Merge pull request #10078 from accumulator/android_qml_qrscan_signals
simplify QR scanner QML interface, remove properties, add results to signals
2025-08-01 13:16:26 +02:00
SomberNight
323fe963bc constants: NETS_LIST to have deterministic ordering
Currently running the help command lists the supported chains in random order.
This patch changes the ordering to be lexicographical.

```
$ ./run_electrum --help
usage: run_electrum [-h] [--version] [-v VERBOSITY] [-D ELECTRUM_PATH] [-w WALLET_PATH] [-P]
                    [--testnet] [--signet] [--mainnet] [--simnet] [--regtest] [--testnet4] [-o]
                    [--rpcuser RPCUSER] [--rpcpassword RPCPASSWORD] [--forgetconfig]
                    <command> ...

[...]

global options:
  -v VERBOSITY          Set verbosity (log levels)
  -D ELECTRUM_PATH, --dir ELECTRUM_PATH
                        electrum directory
  -w WALLET_PATH, --wallet WALLET_PATH
                        wallet path
  -P, --portable        Use local 'electrum_data' directory
  --testnet             Use testnet chain
  --signet              Use signet chain
  --mainnet             Use mainnet chain
  --simnet              Use simnet chain
  --regtest             Use regtest chain
  --testnet4            Use testnet4 chain
  -o, --offline         Run offline
  --rpcuser RPCUSER     RPC user
  --rpcpassword RPCPASSWORD
                        RPC password
  --forgetconfig        Forget config on exit

Run 'electrum help <command>' to see the help for a command
```

```
$ python3 -c "import electrum.constants as k; print(k.NETS_LIST)"
(<class 'electrum.constants.BitcoinTestnet'>, <class 'electrum.constants.BitcoinSignet'>, <class 'electrum.constants.BitcoinSimnet'>, <class 'electrum.constants.BitcoinMainnet'>, <class 'electrum.constants.BitcoinRegtest'>, <class 'electrum.constants.BitcoinTestnet4'>)

$ python3 -c "import electrum.constants as k; print(k.NETS_LIST)"
(<class 'electrum.constants.BitcoinTestnet4'>, <class 'electrum.constants.BitcoinSimnet'>, <class 'electrum.constants.BitcoinTestnet'>, <class 'electrum.constants.BitcoinSignet'>, <class 'electrum.constants.BitcoinMainnet'>, <class 'electrum.constants.BitcoinRegtest'>)
```
2025-07-31 16:44:45 +00:00
ghost43
409af41f04 Merge pull request #10083 from f321x/format_cli_help
cli: set formatter_class for command descriptions
2025-07-31 16:32:53 +00:00
ghost43
dfd480d5dd Merge pull request #10033 from SomberNight/202507_interface_fast_forward
interface: parallel header-chunks download
2025-07-31 15:47:11 +00:00
ghost43
a9b47f7abd Merge pull request #10062 from f321x/handle_qe_swap_task_exceptions
qml: catch exceptions in QESwapHelper transport_task
2025-07-31 15:41:09 +00:00
ghost43
f0618de8c5 Merge pull request #10043 from SomberNight/202507_keystore_cleanup
keystore.py: some clean-up
2025-07-31 15:34:10 +00:00
ghost43
9e0b58296a Merge pull request #10075 from SomberNight/202507_android_rm_blacklist
android build: rm blacklist.txt
2025-07-31 15:31:00 +00:00
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
f321x
3afca6fdfc cli: fix typos
* remove unnecessary ':' from serialize desc
* fix typo in command subparser epilog
2025-07-25 12:53:23 +02:00
f321x
9f470d1d16 cli: set formatter_class for command descriptions
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
```
2025-07-25 12:42:50 +02:00
f321x
6425f9bf75 cli: return closest htlc expiry from check_hold_invoice
Adds a `closest_htlc_expiry_height` value to the `check_hold_invoice` cli command response.
This allows to see the next absolute expiry height of the pending htlcs
of a payment. Note, htlcs will get failed before the actual expiry
height (if block_height + 144 > htlc.cltv_abs).
2025-07-25 11:44:26 +02: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
Sander van Grieken
aaed64c45a android: pass on QR binary scan result data as well
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.
2025-07-24 13:58:45 +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
SomberNight
a94deedc26 android build: rm blacklist.txt
this looks like broken dead code

- the "if" body is never entered as `.buildozer/` gets created by `contrib/android/build.sh`
    8eb3c43603/contrib/android/build.sh (L32)
- `blacklist.txt` is at `contrib/android/blacklist.txt` but the Makefile expects it at the root
    ref https://gitlab.com/fdroid/fdroiddata/-/merge_requests/24948#note_2643399062
- `blacklist.txt` is not referenced anywhere else
2025-07-22 18:05:46 +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