1
0
Commit Graph

19386 Commits

Author SHA1 Message Date
Sander van Grieken
0fcd8f76fc qml: small gridlayout fix in BalanceDetails 2025-09-19 15:36:07 +02:00
ThomasV
5c2c9ac941 network.py: do not require MyEncoder for serializing recent servers
This class is overkill. I am trying to restrict its usage to wallet_db
2025-09-18 12:04:17 +02:00
ThomasV
ff593ea118 Merge pull request #10226 from f321x/fix_8100
wallet: fix AttributeError when getting help text
2025-09-16 12:06:06 +02:00
f321x
b6a4ebecda wallet: fix AttributeError when getting help text
Fixes AttributeError when trying to get `num_sats_can_receive()` in
wallets without lnworker. Fixes https://github.com/spesmilo/electrum/issues/8100#issuecomment-3294556043.

```
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/electrum/gui/qt/request_list.py", line 103, in selection_changed
    self.receive_tab.update_current_request()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/electrum/gui/qt/receive_tab.py", line 237, in update_current_request
    help_texts = self.wallet.get_help_texts_for_receive_request(req)
  File "/usr/lib/python3.13/site-packages/electrum/wallet.py", line 3446, in get_help_texts_for_receive_request
    can_receive = self.lnworker.num_sats_can_receive()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'num_sats_can_receive'
```
2025-09-16 09:38:01 +02:00
ThomasV
12a8cdc842 Merge pull request #10223 from PeytonAllworth/refactor/fstring-upstream
refactor(paymentrequest): use f-string in error message
2025-09-14 11:28:51 +02:00
ThomasV
d36287e57d Merge pull request #10224 from copronista/patch-1
Update plugin.py
2025-09-14 10:32:49 +02:00
copronista
6be8e3ec88 Update plugin.py
https://github.com/spesmilo/electrum/issues/10220
2025-09-13 23:12:44 -04:00
ThomasV
c1ab6cda53 Merge pull request #10219 from SomberNight/202509_consoletaint
crash_reporter: flag reports where console was used in app_version
2025-09-13 11:25:32 +02:00
Peyton Allworth
67f09bf528 refactor(paymentrequest): use f-string in error message 2025-09-12 22:49:02 -07:00
SomberNight
e10cf30627 crash_reporter: flag reports where console was used in app_version
so we don't waste time on weird reports where the user modified
internals at runtime

ref
https://github.com/spesmilo/electrum/issues/10217
https://github.com/spesmilo/electrum/issues/10218
2025-09-11 17:01:52 +00:00
SomberNight
47f1a2d7a2 wallet.get_full_history: rm "include_fiat" arg, infer it from fx
ref https://github.com/spesmilo/electrum/pull/10209#discussion_r2334228490
2025-09-09 17:24:59 +00:00
ghost43
df45233c2f Merge pull request #10209 from f321x/fix_fiat_history_export
qt: add missing fiat values in csv/json history export
2025-09-09 16:56:21 +00:00
ghost43
b4a6de46f4 Merge pull request #10188 from f321x/capacity_warning_zero_amount
qt: receive dialog: also propose swaps for 0 amount invoices
2025-09-09 16:16:23 +00:00
ghost43
4389618f72 Merge pull request #10212 from SomberNight/202509_tests_for_old_hex_seed
tests: restore from old "hex" seed
2025-09-09 15:42:05 +00:00
ghost43
874d89b259 Merge pull request #10211 from f321x/swap_cleanup_check
swaps: only set swap redeemed if preimage is available
2025-09-09 15:40:29 +00:00
ThomasV
61aeffd26f qt: add_to_coincontrol: assert that coins are in self._utxo_dict 2025-09-09 15:55:54 +02:00
ThomasV
64a08f4937 fix #10206: replace for loop with single operation (dicts are threadsafe) 2025-09-09 12:55:37 +02:00
SomberNight
e97d8754c4 tests: restore from old "hex" seed 2025-09-08 17:12:24 +00:00
f321x
e1de1111f8 swaps: only set swap redeemed if preimage is available
For forward swaps this will ensure that the swap only gets set redeemed
and cleaned up after the preimage has been extracted, as it could happen
that `current_height - spent_height > REDEEM_AFTER_DOUBLE_SPENT_DELAY`
is true even if the preimage has not been extracted yet.

For reverse swaps this changes nothing as they always have the preimage.
2025-09-08 17:25:49 +02: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
f321x
55d8974c8f fix: Re-add fiat values to csv history export
Re-add fiat values to the csv history export as they were missing due to
a regression.
2025-09-08 09:58:19 +02:00
f321x
c438f1dfe7 wallet history: also add fiat value to child tx
Makes `get_full_history` also add the fiat values to the children of a
tx, not only to the group itself.
2025-09-08 09:54:01 +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
f321x
45bdd6a827 swaps: add type hints to gui swap suggestion flow
Adds type more type hints and clearer variable names to the swap
suggestion flow.
2025-09-04 12:24:12 +02:00
f321x
3df1af8ee3 qt: SwapDialog: don't force amount on user
When a SwapDialog gets initiated with a recv_amount_sat through the
receive tab the Max Button and edits are disabled and the user is forced
to do a swap with the preset amount. Maybe the user wants to do a larger
swap?
2025-09-04 12:04:13 +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