Commit Graph

2206 Commits

Author SHA1 Message Date
ghost43 09a09057f6 Merge pull request #10548 from SomberNight/202603_lockdown_rpcserver
in GUI mode, only start a limited minimal RPC server
2026-03-31 15:25:52 +00:00
ThomasV efbe1907d7 Merge pull request #10556 from f321x/settings_dialog_guard_network
qt: SettingsDialog: guard self.network access
2026-03-27 15:54:36 +01:00
f321x 1aad09a61d qt: SettingsDialog: guard self.network access
Check if self.network before trying to access it. This would trigger an
exception when toggling the trampoline checkbox in offline mode:
```
 29.13 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/Documents/electrum/electrum/gui/qt/settings_dialog.py", line 133, in on_trampoline_checked
    self.network.run_from_another_thread(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'run_from_another_thread'
 31.00 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/Documents/electrum/electrum/gui/qt/settings_dialog.py", line 131, in on_trampoline_checked
    self.network.start_gossip()
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'start_gossip'
```
2026-03-27 15:40:22 +01:00
SomberNight 726d3995f4 qt gui: more defensive 'gui' RPC (i.e. URI) handling 2026-03-25 18:54:13 +00:00
ThomasV 3012c367ad Qt: move LN fee slider to payment dialog. fixes #10516 2026-03-25 10:53:38 +01:00
ThomasV 3cf2c325d5 Merge pull request #10506 from accumulator/spend_from_coin_selection_refactor
qt: perform 'fully spend' action with coin selection, keep separate from coin control when doing action
2026-03-24 12:46:02 +01:00
f321x 2c541d2663 qt: ElectrumGui: repr(UserFacingException) -> str()
Show UserFacingException in ElectrumGui.start_new_window
as str() to the user, ther doesn't seem to be a good reason
to show its repr?
2026-03-23 10:14:31 +01:00
SomberNight 42ad18b216 rm bip70 support
- could not find a single project that still actually cares about bip70 [0]
    - well except maybe BitPay.
        - but I cannot test with BitPay:
            - they have a testnet3 staging environment on test.bitpay.com
                - but the SSL cert they use for bip70 has expired in 2021
                - the webUI probably also has not been updated since then...
                    - they claim to have added LN support in 2022 in a blog post,
                        but it's not there on test.bitpay.com
            - on mainnet, they require KYC before payment
                - < ... angry noises >
            - their loss then, I don't care.
- this is code that no one wants to maintain

- this does not yet delete the signed bip70 payment data for historical txs
    - but it is no longer possible to export it from the GUI

[0]: https://bitcoinops.org/en/topics/bip70-payment-protocol/
2026-03-20 18:12:55 +00:00
Sander van Grieken 03e95accdc qt, qml: for new transaction notifications, instead of using sign, explicitly say sent/received.
For multiple transactions, split summary in total sent/received and a balance change.

move duplicated code to wallet.get_user_notifications_for_new_txns()
2026-03-20 12:52:22 +01:00
ThomasV 7ee2477b68 Merge pull request #10528 from f321x/qt_swapserver_list_resize
swaps: improve SwapServerDialog, provider CLI, bugfixes
2026-03-19 09:42:05 +01:00
f321x efca1cc511 qt: PluginsDialog: add link to website
Adds a link to the plugins.electrum.org website so users who open the
plugins dialog out of curiosity get guided to the website and can
discover other plugins and learn more about the system.
2026-03-17 12:02:31 +01:00
f321x ffd259287d qt: SwapServerDialog: resize server list with dialog
Waste less space in the dialog by limiting the stretch to 10px and
resize the servers_list with the dialog by setting stretch=1 so it can
be made larger.

Fixes https://github.com/spesmilo/electrum/issues/10519
2026-03-16 12:20:36 +01:00
ghost43 cb696ed6f8 Merge pull request #10504 from accumulator/move_qt_event_listener
common_qt: move QtEventListener and qt_event_listener decorator to common_qt
2026-03-03 17:48:01 +00:00
Sander van Grieken 48916f56bc qt: perform 'fully spend' action with coin selection, keep separate from coin control when doing action.
Also stop timer when dialog is finished, to avoid re-generating txs with the same input coin set, which
results in an exception as these coins have signatures when the swap has started.
2026-03-03 18:46:03 +01:00
ghost43 0cb4e89aee Merge pull request #10503 from accumulator/qt_coins_fully_spend_menu
qt: utxo_list: only enable 'fully spend...' menu if there are unfrozen coins in the selection.
2026-03-03 17:37:58 +00:00
SomberNight 4c27b8de8d qt: utxo_list: add asserts to helper methods that coins are selected
- otherwise they default to selecting all coins, which is unlikely to be what the user intends
- prev commit makes sure this should never happen
2026-03-03 17:29:22 +00:00
f321x 423cc678c8 qt: MyTreeView: close menu if its context changes
Stores the currently open (right-click) menu in MyTreeView
and adds a `close_menu()` method so inheritants can cleanly
close the menu again if the context it was opened upon has changed.

This is utilized by `AddressList` and `UTXOList` to close the menu
if a call to `update()` has chenged the address list in some way or
removed a utxo from the list to prevent the user from trying to use
a utxo that doesn't exist anymore.

Fixes #10464
2026-03-03 17:28:57 +01:00
Sander van Grieken 91efb3e1f4 common_qt: move QtEventListener and qt_event_listener decorator to common_qt 2026-03-03 13:03:46 +01:00
Sander van Grieken f3ba25df7d qt: utxo_list: only enable 'fully spend...' menu if there are unfrozen coins in the selection.
otherwise, when selecting only frozen coins, the set of usable coins is empty, and the menu options
will instead fall back to using ALL coins without informing the user.
2026-03-02 18:04:08 +01:00
ghost43 2c9f4fdbae Merge pull request #10433 from f321x/qt_changelog
qt: add Changelog to Help menu in toolbar
2026-02-25 17:26:06 +00:00
f321x 2df68d9249 qt: console: allow changing font size
Allows changing the font size in the qt Console with
`Ctrl` + `+` and `Ctrl` + `-`.
2026-02-23 17:27:39 +01:00
SomberNight 3afa2fcdf3 locale: gui: show translation completion percentage in language names
In the GUIs, on the language-select screen, show e.g.
  Czech (100%), Danish (13%), Dutch (54%)
instead of
  Czech, Danish, Dutch

- we count the source strings when creating the .pot PO-template file
  and add an "X-Electrum-SourceStringCount" header to it, in the push_locale.py script that uploads the .pot file to crowdin.
  - later, when we run electrum-locale/update.py to download the translations in .po files, these files will also contain the same header.
  - then when the build_locale.sh script compiles those .po files, we can read the header and use it to populate a new "stats.json" file
    that we place in electrum/locale/locale/ and bundle in the all release binaries/distributables.
    - stats.json also includes the number of translated strings for each lang
- at runtime we simply read stats.json and use the values to calculate the percentages
  - a prior implementation did not pre-calc stats.json but did all calculations at runtime (by opening all .mo translations)
    - however that was deemed to slow, hence the build-time pre-calc
      - runtime calc took 40 ms on my laptop, so I guess it could easily take 10x that on an old phone
- just as we have always been very tolerant of any locale files or even the whole locale/ dir missing, we also tolerate stats.json missing
2026-02-21 03:40:09 +00:00
ThomasV 0c32bde721 Merge pull request #10480 from f321x/fix_exc_offline_mode
qt: fix toolbar action exc in offline mode
2026-02-18 17:41:23 +01:00
SomberNight e2c41aabbe locale: don't translate string "Electrum" 2026-02-17 13:48:51 +00:00
f321x 907fff46e5 qt: fix toolbar action exc in offline mode
Fix exception when clicking on "Donate to server" in offline mode by not
showing the "Donate to server" menu action when no network is set.

Raise CancelledError in `fetch_bitcoin_paper` as
`_fetch_tx_from_network` already shows an according error message so the
second, subsequent error message shown by `on_error` is not useful if
`_fetch_tx_from_network` already failed.

```
63.53 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
 File "/home/user/Documents/electrum/electrum/gui/qt/main_window.py", line 864, in donate_to_server
   d = self.network.get_donation_address()
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_donation_address'
```
2026-02-16 09:17:42 +01:00
ghost43 f95e6ac1e8 Merge pull request #10462 from f321x/fix_wizard_tc_exc+
wizard: fix exception when loading new tc wallet
2026-02-11 14:27:00 +00:00
f321x 3905f8d9ec wizard: fix exception when loading new tc wallet
I tried to reproduce:
https://github.com/spesmilo/electrum/issues/8815#issuecomment-2094259186
which triggered the following exception for me:

```
Traceback (most recent call last):
  File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 409, in start_new_window
    window = self._create_window_for_wallet(wallet)
  File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 329, in _create_window_for_wallet
    w = ElectrumWindow(self, wallet)
  File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 290, in __init__
    self.load_wallet(wallet)
    ~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/util.py", line 495, in do_profile
    o = func(*args, **kw_args)
  File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 589, in load_wallet
    self.update_recently_opened_menu()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 741, in update_recently_opened_menu
    for i, k in enumerate(recent):
                ~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not iterable
```

This happens because the trustedcoin wallet is loaded outside of
Daemon.load_wallet() so Daemon.update_recently_opened_wallets()
is not getting called and config.RECENTLY:_OPEN_WALLET_FILES is
still None when we try to iterate through it.
As fix i now use load_wallet() instead of manually
instantiating the Wallet
and additionally handle
RECENTLY_OPEN_WALLET_FILES being None in
ElectrumWindow.update_recently_opened_menu().

My pull request https://github.com/spesmilo/electrum/pull/10121
would have sent this exception to the crash reporter so we
might have noticed it earlier. I think we should not just catch
all exceptions in the wizard like on master as it causes us to
repeatedly miss regressions in the wizard that could be sent to
the crash reporter.
2026-02-11 09:14:35 +01:00
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
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
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
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
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 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
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 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
ThomasV 0c29c5006e Merge pull request #10394 from f321x/cosigner_wallet_event_listener
bugfixes: set psbt_nostr event on aio loop and use correct cb in TxEditor
2026-01-13 13:45:06 +01:00