1
0
Commit Graph

19255 Commits

Author SHA1 Message Date
SomberNight
e97d8754c4 tests: restore from old "hex" seed 2025-09-08 17:12:24 +00:00
ThomasV
dd7919b597 Merge pull request #10203 from SomberNight/202509_plugin_offline_cmd
commands: add clear error that plugin commands cannot be run with -o
2025-09-08 17:17:45 +02:00
SomberNight
b036eaf3eb lnwatcher: add some type hints 2025-09-08 15:01:50 +00:00
ThomasV
317bf998e3 Merge pull request #10204 from SomberNight/202509_wallet_rbf_candidates
qt confirm_tx_dialog: fix wallet.get_candidates_for_batching
2025-09-08 16:49:09 +02:00
ThomasV
ab9f4f734a Merge pull request #10210 from f321x/swap_cb
lnwatcher: catch callback exceptions
2025-09-08 14:58:19 +02:00
f321x
23f158291c lnwatcher: catch callback exceptions
Catch exceptions happening to callbacks to continue calling the
remaining callbacks. Otherwise if the first callback throws an exception
the remaining callbacks aren't going to be called.
2025-09-08 13:37:27 +02:00
ThomasV
2d17252b4b lnworker.has_anchor_channels: return False if channel is closed but not redeemed yet
this fixes the following issue: user cannot spend max until channel is redeemed.
see https://x.com/AnyoneOReally1/status/1964352775245951291
2025-09-08 10:39:41 +02:00
ghost43
fdf8f9d980 Merge pull request #10205 from SomberNight/202509_storage_oschmod
storage.write: make os_chmod best-effort
2025-09-05 23:43:23 +00:00
SomberNight
9d13855c99 storage.write: make os_chmod best-effort
closes https://github.com/spesmilo/electrum/issues/8409
closes https://github.com/spesmilo/electrum/pull/8997
2025-09-05 19:51:33 +00:00
SomberNight
d01e6b8101 qt confirm_tx_dialog: fix wallet.get_candidates_for_batching
I don't understand what the "coins not used" comment meant here.
It was added in the change away from the old config.WALLET_BATCH_RBF option
(ab14c3e138).

The `coins` param *is used* in wallet.get_candidates_for_batching.
Without setting that, the returned set of candidates was restricted to
only base txs that had a large enough change output to cover *all* the newly added outputs.
Instead, it is desirable to allow adding new inputs.
2025-09-05 19:42:56 +00:00
ghost43
969deb2cd9 Merge pull request #10198 from f321x/add_swapserver_summary_cli
swapserver: add commands for stats and swap history
2025-09-05 18:38:34 +00:00
SomberNight
7455cf9dec commands: add clear error that plugin commands cannot be run with -o
note that atm none of the plugin commands are explicitly marked with 'n' but all require it.
Also note that 'w' for plugin commands kind of implies 'n' anyway, as the 'load_wallet' hook relies on having a daemon.

```
$ ./run_electrum -o --testnet labels_pull
Password:
  1.96 | E | __main__ | error running command (without daemon)
Traceback (most recent call last):
  File "/home/user/wspace/electrum/./run_electrum", line 587, in handle_cmd
    result = fut.result()
  File "/usr/lib/python3.13/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/user/wspace/electrum/./run_electrum", line 267, in run_offline_command
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/wspace/electrum/electrum/commands.py", line 202, in func_wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/wspace/electrum/electrum/commands.py", line 2214, in func_wrapper
    kwargs['plugin'] = daemon._plugins.get_plugin(plugin_name)
                       ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_plugins'
```
2025-09-05 18:26:24 +00:00
ghost43
1e55ee8ea2 Merge pull request #10202 from SomberNight/202509_sweep_none
keystore: get_private_keys should not return None
2025-09-05 17:31:41 +00:00
SomberNight
75195b667a keystore: get_private_keys should not return None
closes https://github.com/spesmilo/electrum/issues/10200
2025-09-05 16:10:33 +00:00
f321x
708aefb036 swapserver: add commands for stats
Adds two command to the swapserver plugin to retrieve some stats so swap
providers can see more easily what is going on on their swapserver.
2025-09-05 15:39:51 +02:00
ThomasV
8abe4a1dd4 Merge pull request #10197 from f321x/deprecation_warning_coroutinefunction
chore: replace calls to asyncio.iscoroutinefunction
2025-09-05 13:46:23 +02:00
f321x
e7bb75bc3e chore: replace calls to asyncio.iscoroutinefunction
Replace calls to deprecated asyncio.iscoroutinefunction with calls to
inspect.iscoroutinefunction to prevent the following deprecation
warnings from showing up if running with Python 3.14:
```
/home/user/code/electrum-fork/electrum/util.py:1225: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  assert asyncio.iscoroutinefunction(func), 'func needs to be a coroutine'
/home/user/code/electrum-fork/electrum/util.py:507: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  if asyncio.iscoroutinefunction(func):
/home/user/code/electrum-fork/electrum/util.py:1246: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  assert asyncio.iscoroutinefunction(func), 'func needs to be a coroutine'
/home/user/code/electrum-fork/electrum/lnpeer.py:272: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  assert asyncio.iscoroutinefunction(func), 'func needs to be a coroutine'
/home/user/code/electrum-fork/electrum/util.py:1225: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  assert asyncio.iscoroutinefunction(func), 'func needs to be a coroutine'
/home/user/code/electrum-fork/electrum/util.py:507: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  if asyncio.iscoroutinefunction(func):
```
2025-09-05 10:29:34 +02:00
ghost43
4a9b960ad8 Merge pull request #10195 from SomberNight/202509_tox
ci: use pytest directly instead of tox, and also run unittests with frozen deps
2025-09-03 16:46:30 +00:00
SomberNight
b60d2e9610 ci: add task to run unittests with frozen deps
I think it makes sense to run the tests with both the "latest" dependencies,
and with the pinned dependencies that we package for releases.

Testing with latest can reveal changes/issues with new dep versions,
while testing with pinned is testing what users will actually run.
Previously we were only testing with "latest".
2025-09-03 16:40:54 +00:00
ghost43
3b2c069b86 Merge pull request #10175 from SomberNight/202508_swaps_check_cltv_safety
swaps: add explicit check that (onchain_locktime < LN_locktime)
2025-09-03 16:10:29 +00:00
SomberNight
6583a986a2 ci: tests: move away from tox, just use pytest directly
- it was originally added in https://github.com/spesmilo/electrum/pull/1334,
  with the goal of simplifying running the tests on local dev machines.
  However this usage is not documented anywhere, and AFAIK regular contributors
  don't use it either.
- tox just adds another layer of abstraction that is not that useful IMO
  - I want more control over which electrum-deps are installed, which tox is
    (in this case) unhelpfully abstracting away
2025-09-03 15:33:05 +00:00
ghost43
489d3fa64e Merge pull request #10194 from SomberNight/202509_getwallet_win_path
daemon: get_wallet: handle OSError for weiiird paths
2025-09-03 15:22:07 +00:00
SomberNight
c68deb25ff daemon: get_wallet: handle OSError for weiiird paths
I think _wallet_key_from_path should not raise.
This is probably the sane way to deal with this.
Though all this is assuming that os.path.realpath can be treated as consistent/stateless.

closes https://github.com/spesmilo/electrum/issues/10182
2025-09-03 14:14:22 +00:00
SomberNight
4a0a3bb38a contrib: shell scripts: add quotes around more variables 2025-09-02 17:33:06 +00:00
ghost43
1c695dd53a Merge pull request #10192 from f321x/fix_padding_qml_exc_dialog
qml: android: add padding to report dialog in ExcDialog
2025-09-02 14:07:45 +00:00
accumulator
8d8af1a2bb Merge pull request #10187 from accumulator/hww_offline_err_fix
don't sys.exit() from run_offline_command, this leads to wait on lock that never releases
2025-09-02 13:27:18 +02:00
f321x
debb4da90d qml: android: add padding to report dialog in ExcDialog
Adds padding to the report content dialog in the QML ExceptionDialog if
required on android.
Followup https://github.com/spesmilo/electrum/pull/10178
2025-09-02 10:32:10 +02:00
ghost43
7dc33d1fe1 Merge pull request #10191 from SomberNight/202509_type_hints_qml_txf
qml: add some type hints to qetxfinalizer
2025-09-01 17:20:52 +00:00
SomberNight
c8a14cc2cc qml: add some type hints to qetxfinalizer 2025-09-01 17:09:38 +00:00
ghost43
77eb3ff01e Merge pull request #10148 from accumulator/android_16kb_page_alignment
android: 16kb alignment updates
2025-09-01 16:12:24 +00:00
ghost43
0967c0eb96 Merge pull request #10178 from f321x/android15_edge_to_edge_compatibility
android: make app compatible with edge-to-edge layout
2025-09-01 14:02:26 +00:00
f321x
0263b5ecc1 qml: adapt exception dialog to edge-to-edge layout
Even though the exception dialog inherits from ElDialog the padding
didn't work as it overwrites the properties of the ElDialog. So the
padding has to be applied separately to the ExceptionDialog.
2025-08-28 10:17:32 +02:00
Sander van Grieken
87d82f38c5 android: 16kb alignment updates
p4a ref: electrum_20240930_android_16kb_page_alignment
Dockerfile: obtain 16kb aligned NDK r23 from google CI (dl-ndk-ci.sh)
barcode, zxing-cpp: add 16kb align patch
build_tools_util.sh: add function to apply a patch
2025-08-28 09:24:40 +02:00
f321x
f1dfe5e248 qml: LoadingWalletDialog: add some padding
add some padding at the bottom of the LoadingWalletDialog so the
spinning circle is not directly at the bottom of the dialog, looks a bit
nicer this way.
2025-08-27 15:17:19 +02:00
f321x
9871931bf3 android: make QR code scanner e2e compatible
Makes the Java QR code scanner edge-to-edge compatible by padding the
hintTextView and the pasteButton.
2025-08-27 15:17:17 +02:00
f321x
5f0180910c qml: add padding to ElDialog for android e2e 2025-08-27 15:17:16 +02:00
f321x
53595e1be7 qml: pad main view if e2e enforcement is active 2025-08-27 15:17:13 +02:00
f321x
4b30b097a9 qml: qeapp: add methods to retrive system bar heights 2025-08-27 15:17:04 +02:00
f321x
c365272745 android: bump target sdk to 35 2025-08-27 13:57:22 +02:00
Sander van Grieken
18f6b88982 don't sys.exit() from run_offline_command, this leads to wait on lock that never releases. 2025-08-26 12:24:03 +02:00
SomberNight
835b04d5c6 swaps: add explicit check that (onchain_locktime < LN_locktime)
This was already implicitly checked. This diff makes the check explicit, and serves as an additional sanity-check.
- for client-forward-swaps, we have
  - "cltv safety requirement: (onchain_locktime < LN_locktime),   otherwise client is vulnerable"
  - server chooses onchain locktime delta = 70
    71255c1e73/electrum/submarine_swaps.py (L701)
  - client checks that onchain locktime delta is <100
    71255c1e73/electrum/submarine_swaps.py (L887)
  - client chooses LN locktime delta = 432
    71255c1e73/electrum/submarine_swaps.py (L907)
- for client-reverse-swaps, we have
  - "cltv safety requirement: (onchain_locktime < LN_locktime),   otherwise server is vulnerable"
  - server chooses onchain locktime delta = 70
    71255c1e73/electrum/submarine_swaps.py (L598)
  - server chooses LN locktime delta: unset, i.e. our default of 147
    71255c1e73/electrum/submarine_swaps.py (L612)
    71255c1e73/electrum/lnworker.py (L2273)
2025-08-26 04:55:10 +00:00
SomberNight
71255c1e73 contrib/make_download: sort signers, instead of random fs order 2025-08-25 12:23:49 +00:00
SomberNight
d9480fe339 contrib: add "set -e" to bash scripts where missing 2025-08-25 12:22:37 +00:00
ThomasV
a8b86f2c72 Merge pull request #10173 from SomberNight/202508_release462
prepare release 4.6.2
4.6.2
2025-08-24 20:14:50 +02:00
SomberNight
c95112643b prepare release 4.6.2 2025-08-24 18:03:20 +00:00
ghost43
68d93d186c Merge pull request #10172 from SomberNight/202508_qml_wallet_ks_password
daemon: load_wallet: add force_check_password arg, and use it in qml
2025-08-24 18:00:57 +00:00
SomberNight
f98b6a3928 update locale 2025-08-23 18:59:14 +00:00
SomberNight
92bdc4d4ca daemon: load_wallet: add force_check_password arg, and use it in qml
- fix: qml gui errors when trying to open a wallets with only keystore-encryption
  - fixes https://github.com/spesmilo/electrum/issues/10171
- qml gui to prompt for password on wallet open even if wallet is not storage-encrypted
2025-08-23 16:54:48 +00:00
SomberNight
23a82f328f util: fix DebugMem helper
```
 28.99 | I | util.DebugMem | Start memscan
 29.10 | E | plugin.Plugins |
Traceback (most recent call last):
  File "...\electrum\util.py", line 405, in run_jobs
    job.run()
  File "...\electrum\util.py", line 376, in run
    self.mem_stats()
  File "...\electrum\util.py", line 368, in mem_stats
    if isinstance(obj, class_):
  File "...\Python310\lib\abc.py", line 119, in __instancecheck__
    return _abc_instancecheck(cls, instance)
  File "...\electrum\simple_config.py", line 609, in __getattribute__
    raise AttributeError()
AttributeError
```
2025-08-23 14:51:01 +00:00
ghost43
53271a71d4 Merge pull request #10169 from SomberNight/202508_swaps_more_cleanup
swaps: more cleanup
2025-08-23 12:54:02 +00:00