1
0
Commit Graph

19099 Commits

Author SHA1 Message Date
f321x
b93ffdd79d appimage: bump appimagetool to new version/repo
Updates the appimage build scripts to use the newer
https://github.com/AppImage/appimagetool tool to bundle the appimage
instead of the discontinued https://github.com/AppImage/AppImageKit.
To prevent the new appimagetool from downloading a random "latest"
appimage runtime (`type2-runtime`) binary this PR also adds
functionality to clone and build
https://github.com/AppImage/type2-runtime from source. This is done
using the build scripts provided in the `type2-runtime` repository,
however the Dockerfile they use for building is replaced by a copy with
pinned package versions to prevent issues with reproducibility.

This should fix the issue of missing libfuse2 which users of the appimage
have on "modern" distributions.
The new `type2-runtime` is statically linked and includes the required
dependencies now instead of relying on the host to provide it.
2025-08-12 11:06:11 +02:00
SomberNight
db43e0c7da contrib/make_download: invert GPG name trickery
if I ran the script with the *.sombernight_releasekey.asc sigs present in dist/,
"SomberNight" and "sombernight_releasekey" were both included as signers
2025-08-12 00:04:12 +00:00
ghost43
a8118be4d5 Merge pull request #10120 from f321x/fix_10117
fix: wizard: qml: call checkIfLast in WCHaveSeed
2025-08-11 15:45:57 +00:00
f321x
e6f73522cb fix: wizard: qml: call checkIfLast in WCHaveSeed
When the user has already loaded a wallet in QML and tries to restore a
new wallet `WCHaveSeed.qml` incorrectly shows a `Finish` button instead
of a `Next` button and raises a KeyError if the user clicks on Finish
instead of resolving the passphrase input view (regression from
https://github.com/spesmilo/electrum/pull/10016).

This happens because `last` of `have_seed` depends on
`NewWalletWizard.is_single_password()` and NewWalletWizard.wants_ext(wizard_data).
`is_single_password()` is true if a wallet is already loaded,
while `wants_ext(wizard_data)` is false as `wants_ext()` depends on `seed_extend: True` in
`wizard_data` which only gets set after `apply()` of `WCHaveSeed` gets
called, however the evaluation of `WCHaveSeed` being the last view
happens before the view is shown.
By calling `checkIsLast()` in the validation timer of `WCHaveSeed` the
`last` property gets set again after `apply()` has been called, so
the view is guaranteed to correctly show either the `Finish` or `Next` button
after a seed has been entered.
2025-08-11 15:05:17 +02:00
ghost43
186b8ec2ab Merge pull request #10111 from SomberNight/202508_iface_cache_broadcast_tx
interface: don't request same tx from server that we just broadcast to it
2025-08-08 17:28:34 +00:00
ghost43
9ae716ae6d Merge pull request #10114 from SomberNight/202508_change_gap_limit_for_change
wallet: add internal support for changing gap_limit_for_change, and use it in tests
2025-08-08 17:22:17 +00:00
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
98c4c9709f tests: interface: more aggressive clean-up 2025-08-08 14:35:03 +00:00
SomberNight
cd8bbcd2bb tests: don't block forever if a prior unit test raised during setUp 2025-08-08 14:35:00 +00:00
SomberNight
05da50178b interface: don't request same tx from server that we just broadcast to it
Often when the wallet creates a tx, the flow is:
- create unsigned tx
- sign tx
- broadcast tx, but don't save it in history
- server sends notification that status of a subscribed address changed
- client calls scripthash.get_history
- client sees txid in scripthash.get_history response
- client calls blockchain.transaction.get to request missing tx

Instead, now when we broadcast a tx on an interface, we cache that tx *for that interface*,
and just before calling blockchain.transaction.get, we lookup in the cache.
Hence this will often save a network request.
2025-08-08 14:34:56 +00:00
SomberNight
427b0d42b6 lrucache: add type hints 2025-08-08 14:34:53 +00:00
SomberNight
138e2f6ba0 add "lrucache" module, extracted from the 3rd-party tkem/cachetools library
functools.lru_cache in the stdlib is not generic enough. That can be used to cache the results of a single pure function,
however I have usecases where one function is supposed to populate the cache, while another function consumes it.
https://docs.python.org/3/library/functools.html#functools.lru_cache

This is stripped down and extracts just the LRUCache from tkem/cachetools. It is relatively short, and very mature code.
I don't expect that we have to "follow" upstream, etc. There likely won't be relevant changes upstream.
Effectively, we are forking and bundling this code.

similar to 04582cc353
2025-08-08 14:34:49 +00:00
SomberNight
d47f38b0e0 tests: interface: impl get_tx/broadcast_tx for electrum server 2025-08-08 14:34:46 +00:00
SomberNight
8efc2aab5e tests: interface: implement toy electrum server 2025-08-08 14:33:38 +00:00
ThomasV
971e3f1945 submarine_swaps: fix swapserver dying taskgroup (follow-up 21e3fd91dd and 4490bd3a76) 2025-08-08 16:17:01 +02:00
SomberNight
8b99c218b4 network: move broadcast_transaction move network to interface.py 2025-08-07 16:29:49 +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