9398 Commits

Author SHA1 Message Date
ghost43 f2a70357c3 Merge pull request #10121 from f321x/qml_create_storage_exc
wizard: raise more specific exc in create_storage() and pass some to crash reporter
2026-02-10 16:55:07 +00:00
SomberNight 5ca2699580 qt: wizard: (trivial) simplify prevprev (HEAD~1)
ref 457a09219e
2026-02-10 16:47:49 +00:00
ghost43 aefc4aa5b3 Merge pull request #10459 from SomberNight/202602_lnaddr_format_rtags
lnwallet.pay_to_node: log r_tags from invoice
2026-02-09 17:06:21 +00:00
SomberNight 21c1dd8c96 Merge remote-tracking branch 'spesmilo/pr/10451': history export
merges https://github.com/spesmilo/electrum/pull/10451
2026-02-09 16:40:43 +00:00
ThomasV 7e73aa7b7a CLI: separate list_channels and list_channel_backups
Add '--public' option flag to list public channels
2026-02-09 11:39:54 +01:00
ThomasV b03d6a478d gossip: broadcast channel updates along with channel announcements
The channel update in mark_open is only sent once, and only to the
channel peer. In addition, it seems to be discarded by Eclair.
2026-02-09 11:00:16 +01:00
ThomasV b2a3e08ac8 ignore exceptions in process_gossip
A failing signature verification should not kill the taskgroup
2026-02-09 10:58:24 +01:00
f321x 2fd74c1884 qml: wizard: differentiate between create_storage exc types
Differentiate between the `UserFacingException` and other exceptions
when creating the storage. Forward other exceptions to the reporter so
they can get fixed.
2026-02-04 11:56:51 +01:00
f321x 457a09219e qt: wizard: differentiate between create_storage exc types
Differentiate between the `UserFacingException` and other exceptions
when creating the storage. Forward other exceptions to the reporter so
they can get fixed.
2026-02-04 11:56:49 +01:00
f321x 06f9d87523 wizard: raise more specific exc in create_storage()
Modifies `NewWalletWizard.create_storage()` to raise more specific
exception types instead of plain `Exception`. This should allow the
calling GUI to separate between non-bug exceptions (like invalid user
input), and bugs which should not happen and be
passed to the bug reporter.
2026-02-04 11:56:44 +01:00
ghost43 6083808191 Merge pull request #10461 from romanz/ts5
Support TS5 in `TrezorClientBase.device_model_name()`
2026-02-04 02:26:26 +00:00
Roman Zeyde 38a0acffb4 Support TS5 in TrezorClientBase.device_model_name() 2026-02-03 21:37:29 +01:00
ghost43 9644283988 Merge pull request #10441 from f321x/fix_10437
Wizard/qt/qml: validate server address input, fix #10437
2026-02-03 17:09:18 +00:00
f321x e1dac558dd history export: make fees bitcoin, add hook, rm local tx
Change fees from sats to bitcoin so the fee value is consistent with the
other values.
Fixes #10445

Also adds a plugin hook so plugins can create fancy history exports.

And stops adding unconfirmed/local transactions to the history as they
are unordered and make the export non-deterministic. Also transactions
that haven't happened yet don't seem useful for accounting.
2026-02-03 18:01:12 +01:00
f321x 68144588dd move history export from HistoryList to Abstract_Wallet
Moves the history export function to Abstract_wallet so it can be
unittested and called from other places like the cli or QML too.
2026-02-03 18:01:11 +01:00
f321x 34f008efa2 qt: make do_export_history independent of HistoryList
So it can be moved out of HistoryList, get unittested and potentially
used by QML too for example.

Also fix inconsistency between fiat_value and fees_fiat, sometimes if
fiat_value was `No Data` (value=None), fees_fiat was '0' as
fees_fiat.value was Decimal() instead of None.
2026-02-03 18:01:04 +01:00
SomberNight 4d4cff7840 lnwallet.pay_to_node: log r_tags from invoice
and add helper "format_bolt11_routing_info_as_human_readable"
2026-02-03 07:36:20 +00:00
ghost43 dcfef1111f Merge pull request #10457 from bgridley/ledger-nano-gen5-support
Support for Ledger Nano Gen5
2026-02-02 16:36:40 +00:00
ThomasV 3979d7016e channels_list: remove anchor icon
Anchor outputs are not optional, so this icon does not add meaningful
information to the user. It is only marginally useful for debuging.
2026-02-02 10:12:58 +01:00
Ben Gridley 2c058c97eb add support for Nano Gen5 2026-02-01 16:35:04 -07:00
ghost43 b7e58f659a Merge pull request #10448 from f321x/gossip_0126
lnpeermgr: fix proxy check in add_peer, don't connect to onion peers if no proxy
2026-01-29 18:52:10 +00:00
ThomasV be3e05d7c0 lnhtlc: move LOG_TEMPLATE to top.
This commit only moves code.
2026-01-28 17:49:36 +01:00
ThomasV 5767913e07 lnhtlc: remove unneeded non-initiator fee_update in log 2026-01-28 12:32:59 +01:00
ThomasV e1103266e6 lnmsg: pass filename as parameter instead of boolean 2026-01-28 12:08:35 +01:00
f321x 79ef429b3c lnworker: don't connect to onion peers if no proxy
When gossip is enabled we waste a lot of time trying to connect
to onion peers if we don't have a proxy enabled. We should just skip
them and try to connect to clearnet peers instead.
2026-01-27 13:14:31 +01:00
f321x db6b6a16f8 lnpeermgr: add_peer: fix check if proxy enabled
LNPeerManager.add_peer would only check if self.network.proxy is set,
which it is always as Network is initialized with self.proxy =
ProxySettings(). Instead it should check if proxy is set and enabled.
2026-01-27 12:49:19 +01:00
f321x 1c5408cccb ServerConnectWizard: don't set autoconnect on user cancel
Don't set the NETWORK_AUTO_CONNECT config if the user checked the custom
server config checkbox and then cancels the wizard, so the next time the
user starts the wizard they again will have the choice instead of
silently being forced into a random server.
Currently if the user cancels the wizard during the network config the
welcome component will already have set the NETWORK_AUTO_CONNECT config
to False (as the user selected the custom server checkbox), preventing
the wizard from starting again on the next startup.
2026-01-26 15:28:54 +01:00
f321x 10aecf66fd ServerConnectWizard: use default server instead of ''
Passes the default server (Network.default_server) to
Network.set_parameters instead of an empty string in
ServerConnectWizard.do_configure_server to avoid a traceback like in
I am not entirely sure how the user in #10437 managed to trigger
the exception as Network.set_parameters should already exit early at
`not self._was_started` in the Wizard as the network shouldn't have been
started yet during the wizard. However passing the default ServerAddr
instead of an empty string to set_parameters should avoid this
exception.
2026-01-26 14:40:04 +01:00
f321x 5952d8c614 qml: validate server address in ServerConfig
Same as Qt, validate the server address the user enters and prevent the
user from continuing in the wizard or clicking 'Ok' in the ServerConfig
if the entered address is clearly invalid.
2026-01-26 14:40:02 +01:00
f321x c3d1b2046a qt: ServerWidget/wizard: validate server_e
The `ServerWidget` didn't validate the input of server_e, which allowed
the user to enter an invalid server connection string and exit the
dialog without knowing they entered an invalid string.
In the wizard this behavior is very misleading as the user explicitly
wanted to use a custom server, can click next after entering an invalid
server, and we will just silently fall back to automatic server selection.

This change will disable the "Next" button in the wizard if an invalid
address has been entered and show a red background in the server_e while
the input is not valid, so the user clearly sees that this input is not
going to be used.
2026-01-26 14:39:59 +01:00
ThomasV cfe2a57f2c add plugin hook to utxo list menu 2026-01-24 11:17:47 +01:00
SomberNight 0e07128ccf qt: fix: addresses tab broken for imported watchonly wallets
fixes https://github.com/spesmilo/electrum/issues/10435

regression from https://github.com/spesmilo/electrum/pull/10376
2026-01-23 17:35:14 +00:00
f321x f0fc8a9691 qt: add changelog action to help menu in toolbar
Adds a "Changelog" action to the "Help" menu of the toolbar. This allows
users to open the RELEASE-NOTES file in the browser (from github).
2026-01-23 10:20:54 +01:00
ThomasV d2882371a4 bump version number to 4.7.0 2026-01-22 16:22:42 +01:00
ghost43 e286a49340 Merge pull request #10428 from SomberNight/202601_wallet_objs_not_gced
fix util.CallbackManager memory leak
2026-01-22 15:05:22 +00:00
SomberNight 08fa871f39 update block header checkpoints 2026-01-22 14:55:02 +00:00
ThomasV d9091784e7 update locale 2026-01-22 14:02:19 +01:00
ThomasV 16c9bc25b7 Merge pull request #10399 from f321x/qt_sort_cosigners
qt: WalletInfoDialog: sort keystores by root fingerprint
2026-01-22 10:35:04 +01:00
ThomasV 1ae74088e9 Merge pull request #10247 from f321x/improve_send_change_to_ln
qt: improve send_change_to_lightning feedback
2026-01-22 10:31:05 +01:00
f321x 2d97717e99 qt: TxEditor: restructure submarine payment messages
Show:
error
amount details
\n
proposed action

instead of:
error
proposed action
amount details
2026-01-22 10:10:10 +01:00
f321x 1b28e6bf73 TxEditor: move swap request to TxEditor
Moves the logic requesting the forward swap into the TxEditor so it can
use the open transport and doesn't have to reconnect to the relays
again.

Also disables the "Preview" button in the TxEditor when the transaction will
send change to lightning.
This should prevent the user from saving the transaction to history and
broadcasting it later or exporting it and broadcasting it through some
external way.
Broadcasting needs to happen directly after the TxEditor so we can send
the second rpc call to the swapserver and await the incoming htlcs
before broadcasting the (funding-) transaction.
2026-01-22 10:09:29 +01:00
f321x a1841600a1 TxEditor: update dynamically based on swap transport
Update the TxEditor (onchain tab) if Send change to lightning is enabled
and the swap transport changes. Connect to swap transport if send change
to lightning gets enabled or if it is enabled and the TxEditor gets
opened.
This allows to nicely show the swap fees without blocking the UI to wait
until the swap manager gets initialized.
2026-01-22 10:09:28 +01:00
f321x 7b828a8317 wallet: check swap provider liquidity for send change to ln
Check the swap providers liquidity as well if we try to send change to
lightning in `make_unsigned_transaction`. It is now expected that the
swap_manager is already initialized when calling
`make_unsigned_transaction`, otherwise no dummy output will get added.
2026-01-22 10:09:26 +01:00
f321x 40811abe45 qt: TxEditor: separate swap transport from tab
Separates the swap transport initialization logic from the submarine
payment tab logic so it can be used for the send change to lightning
functionality too.

Also makes the gui updates on transport establishment more thread safe
by using pyqtSignals instead of calling gui methods from the asyncio
thread.
2026-01-22 10:09:24 +01:00
f321x 844312f5f6 TxEditor: move submarine payment help text to messages
Moves the help text for submarine payments to messages.py
2026-01-22 10:09:22 +01:00
f321x 4f3274e4c6 qt: TxEditor: extend messages for send change to ln
Extend TxEditor.get_messages() with errors for the send change to
lightning function so users see why it wasn't used even though it is
enabled.
2026-01-22 10:09:15 +01:00
SomberNight cc4611f43d util.CallbackManager: follow-up prev: fix deadlock 2026-01-21 17:51:03 +00:00
SomberNight 87540dbe3e util.EventListener: store WeakMethods in CallbackManager to avoid leaks
This patch changes the CallbackManager to use WeakMethods (weakrefs) to
break the ref cycle and allow the GC to clean up the wallet objects.
unregister_callbacks() will also get called automatically, from
EventListener.__del__, to clean up the CallbackManager.

I also added a few unit tests for this.

fixes https://github.com/spesmilo/electrum/issues/10427

-----

original problem:

In many subclasses of `EventListener`, such as `Abstract_Wallet`, `LNWatcher`,
`LNPeerManager`, we call `register_callbacks()` in `__init__`.
`unregister_callbacks()` is usually called in the `stop()` method.

Example - consider the wallet object:
- `Abstract_Wallet.__init__()` calls `register_callbacks()`
- there is a `start_network()` method
- there is a `stop()` method, which calls `unregister_callbacks()`
- typically the wallet API user only calls `stop()` if they also called
  `start_network()`.

This means the callbacks are often left registered, leading to the wallet
objects not getting GC-ed. The GC won't clean them up as
`util.callback_mgr.callbacks` stores strong refs to instance methods
of `Abstract_Wallet`, hence strong refs to the `Abstract_Wallet` objects.

An annoying example is `daemon.check_password_for_directory`, which
potentially creates wallet objects for all wallet files in the datadir.
It simply constructs the wallets, does not call `start_network()` and
neither does it call `stop()`.
2026-01-21 17:49:41 +00:00
f321x caff7db493 plugin: make DeviceMgr.run non-blocking, fix lock
Prevents `DeviceMgr.run()` from blocking the `Plugins` `DaemonThread` by
scheduling the hww timeout check instead of awaiting its result on the
`Plugins` thread.

If something in the `_hwd_comms_executor` thread is waiting for user
input, e.g. when setting up a hww in the wizard the user needs to
unlock the hww for `HardwareClientBase.get_xpub()` to return, the
`_hwd_comms_executor` is blocked. If then `DeviceMgr.run()` gets called by
the `Plugins` `DaemonThread` concurrently and tries to check the hww
timeout on the `_hwd_comms_executor` as well the `DaemonThread` is
blocked too until the `_hwd_comms_executor` gets unblocked (and the
`DaemonThread.job_lock` is taken.

Now if something tries to take the `DaemonThread.job_lock` it blocks as
well, so if a user e.g. tries to load a new plugin from the plugins
dialog the whole gui thread will freeze until the hww gets unlocked.
2026-01-21 13:57:04 +01:00
f321x d6b6fb8a6b qml: shorten max brightnes preference string
Shorten the max brightness preference string so it fits in a single line
and disable it if the system is not on Android.
2026-01-21 10:37:45 +01:00