1
0
Commit Graph

3940 Commits

Author SHA1 Message Date
f321x
aee0f8fb54 qml: OpenWalletDialog: load any wallet if password matches
If the user has wallets with different passwords (non-unified pw) and
enters a password on startup that fails to unlock the recently used
wallet this change will automatically open any other wallet if there
is another wallet that can be unlocked with this password.
2025-12-18 17:54:52 +01:00
f321x
ba379b7da4 qml: LoadingWalletDialog: fix ressource leak
When closing the OpenWalletDialog without unlocking a wallet the
LoadingWalletDialog wouldn't get properly cleaned up as the
LoadingWalletDialog.visible was never set true. This causes the
connections to accumulate and the callbacks won't get unregistered after
closing the LoadingWalletDialog again.
2025-12-18 17:54:51 +01:00
f321x
70084750ef qml: show wallet list as root if no wallet is loaded
Shows Wallets.qml as root if no wallet is loaded and removes the logic
for no loaded wallet from the WalletMainView as WalletMainView won't be
shown anymore without a Daemon.currentWallet.
2025-12-18 17:54:28 +01:00
f321x
02abc0e6cd qml: enforce single password on password change
If a qml user with non-uniform wallet passwords tries to change their wallet
password this will force them to change it to a password that is used by
at least one other wallet. This will guide them towards a single wallet
password and prevents the number of different passwords from increasing.
2025-12-18 13:10:36 +01:00
f321x
378a9e6112 qml: disable 'Create Wallet' before first unlock
If the user has not unlocked any wallet yet and tries to create a new
wallet in the overview a dialog will prompt them to first unlock an
existing wallet in order to be able to create a new wallet.

This ensures they remember at least one password so they can complete
the wizard. The wizard will ask them for an existing password later and
it would be annoying for the user to go through all steps (writing down
the seed etc.) only to find out they need a password they don't
remember. This way they can reinstall the app right before going through
the wizard.
2025-12-18 11:07:37 +01:00
f321x
3b028b06a0 qml: enforce use of existing password for wallet creation
When creating a new wallet in a Electrum instance with existing wallets
this change forces the user to reuse a password of any existing wallet
if `SimpleConfig.WALLET_USE_SINGLE_PASSWORD` is True.
This prevents the amount of different passwords from increasing and
guides the user towards a single wallet password (the intended default).
2025-12-17 14:01:41 +01:00
f321x
7ccf118755 qt: make ElectrumWindow.lightning_button wider
Qt was showing the lightning_button percentage string while syncing gossip
as `...` instead of the percentage as the minimum width of the button
seemed too small. Increasing this a bit fixes the issue.
2025-12-12 09:50:26 +01:00
SomberNight
37db6ea7e8 transaction: tx_from_any: rm all whitespaces from str, none from bytes
- whitespaces are safe to remove from strings, and is convenient if we do this for users
- bytes-like inputs should be left alone: individual bytes that look like whitespaces can appear in them anywhere
  - even stripping the leading/trailing whitespaces is not safe to do: the first byte of the nVersion or the last byte of the nLocktime might look like whitespace too!
- instead, leading/trailing whitespaces can be stripped closer to where they are input, e.g. in the GUI
  - e.g. ".txn" files that we ourselves create contain a complete tx as a hex string, with a trailing final newline in the file
    - instead of reading that as bytes, we can read it as text
  - ".psbt" files OTOH are binary
2025-12-11 16:48:50 +00:00
ghost43
0eefcbae9c Merge pull request #10357 from f321x/fix_ledger_exception
wizard: hw: handle UserFacingException during encryption step
2025-12-10 17:04:59 +00:00
ghost43
20db0d2311 Merge pull request #10358 from SomberNight/202512_lnworker_get_chan_by_id
lnworker/lnpeer: don't use lnworker.channels.get(chan_id)
2025-12-10 16:47:04 +00:00
f321x
4712417969 wizard: handle UserFacingException in WCWalletPasswordHardware
Handles `UserFacingException` in the `WCWalletPasswordHardware` step of
the hardware wallet wizard flow. This fixes the previous FIXME and
prevents the crash reporter from getting triggered if the the user e.g.
disconnects his hardware wallet during the wallet encryption step.
2025-12-10 17:45:15 +01:00
SomberNight
c465f7c3e0 lnworker/lnpeer: don't use lnworker.channels.get(chan_id)
- lnworker.channels takes a copy of the whole dict, to make it thread-safe
- in LNWallet class, can just use self._channels.get(chan_id)
- otherwise there is lnworker.get_channel_by_id
- same for lnpeer.channels.get and lnpeer.get_channel_by_id
2025-12-10 16:14:31 +00:00
f321x
e1f1e6f788 qt: lnurlw: catch UserCancelled on lnurlw withdrawal
Catch the UserCancelled exception if the user cancels the lnurlw
coroutine dialog during the withdrawal.
2025-12-10 10:55:16 +01:00
ghost43
f8fc2b63e3 Merge pull request #10271 from f321x/fix_save_payment_info
lightning: fix self payments (e.g. rebalance)
2025-12-05 17:19:39 +00:00
SomberNight
cdcac8cb09 openalias: always enforce DNSSEC validation succeeds 2025-12-05 17:06:41 +00:00
SomberNight
49430e9722 qml: fix: paying to openalias
regression from in https://github.com/spesmilo/electrum/pull/9993
    7d0ac64d06
2025-12-05 16:12:04 +00:00
ThomasV
32c677bed0 Qt wizard: bugfix: standardize_path in WCWalletName
without this, any wallet that is not in the config
wallet_path cannot be open.
2025-12-03 11:45:51 +01:00
f321x
923d48f9db lnworker: differentiate PaymentInfo by direction
Allows storing two different payment info of the same payment hash by
including the direction into the db key.
We create and store PaymentInfo for sending attempts and for requests (receiving),
if we try to pay ourself (e.g. through a channel rebalance) the checks
in `save_payment_info` would prevent this and throw an exception.
By storing the PaymentInfos of outgoing and incoming payments separately in
the db this collision is avoided and it makes it easier to reason about
which PaymentInfo belongs where.
2025-12-01 18:39:56 +01:00
ghost43
125b7ee0d7 Merge pull request #10319 from f321x/fix_lightning_num_sats_can_send
lnworker: use config lightning fee for estimate
2025-11-28 15:35:05 +00:00
f321x
c575abc8e2 qt: update tabs on exit of SettingsDialog
Update the tabs after the SettingsDialog gets closed, some values might
have to be updated according to the new configuration.
2025-11-28 16:25:39 +01:00
ThomasV
bcbc1b4e6e Merge pull request #10328 from f321x/improve_lnfee_slider
qt: SettingsDialog: update ln fee config on slider moved
2025-11-28 14:06:13 +01:00
ThomasV
128026a442 SwapProvidersButton class
factorize code that is used in both SwapDialog and Submarine payments
2025-11-28 13:31:14 +01:00
ThomasV
8bec3eafd2 swaps dialog: in callbacks, update either send or receive field, depending on which one follows
before this, the content of the non-following field could be modified by callbacks
2025-11-28 10:49:23 +01:00
f321x
088f273d9b qt: SettingsDialog: update ln fee config on slider moved
When moving the lightning fee slider in the SettingsDialog by clicking
on the range instead of pulling the slider the new fee value wouldn't
get stored in the config as the sliderRelased signal is only emitted
when the slider is pulled.
This change updates it on valueChanged.
2025-11-28 09:55:32 +01:00
SomberNight
bc2bd48516 qml: (trivial) QEConfig.formatMilliSats: conv unused fallback to assert 2025-11-27 16:14:52 +00:00
Sander van Grieken
c519083b9b qml: show lightning invoice amounts with msat precision, allow msat precision entry for no-amount lightning invoices 2025-11-27 12:38:57 +01:00
Sander van Grieken
e137c888a1 qeconfig: fix btc amount regex, add msat regex property, add regex tests 2025-11-27 12:38:49 +01:00
Sander van Grieken
93c9dd9d12 qml: refactor invoice amount checks, msat precision for lightning.
add qeconfig unit tests for conversion methods.
2025-11-27 12:38:49 +01:00
Sander van Grieken
0f2a41e078 simple_config: factor out self.decimal_point and self.get_decimal_point() in favor of self.BTC_AMOUNTS_DECIMAL_POINT 2025-11-27 12:38:49 +01:00
f321x
3b80795e9c qt: move pubkey_to_q_icon in qt.util
Move the pubkey_to_q_icon utility function from qt.swap_dialog in
qt.util.
2025-11-27 11:31:10 +01:00
f321x
8a70fdcb81 qt: expose swaps to address as Submarine Payments
Exposes reverse submarine swaps to an external/specific address in the
TxEditor gui as "Submarine Payments". The user can enter a onchain
address in the Send Tab and then pay it from the lightning balance in
the send tab by enabling the Submarine Payments option in the TxEditor
dialog menu and switching to the Submarine Payment tab in the Tab bar.
2025-11-27 11:17:53 +01:00
SomberNight
e6071bbf5d qml: fee histogram colours: extend colour palette to cover sub-1 s/b
Currently on master the qml fee histogram colours are calculated for feerates clamped to [1, 600] sat/vbyte. I want to extend it to now cover [0, 600] sat/vbyte.
I would like to extend it in a way that does not change the existing colour meanings/mapping, so not just e.g. doing an offset.

follow-up bd6dfc53a2
2025-11-15 01:46:31 +00:00
Sander van Grieken
81c83f8318 qeinvoice: query self.status once in update_userinfo() and determine_can_pay() 2025-11-13 12:40:37 +01:00
ThomasV
5cb0902793 Merge pull request #10299 from f321x/pay_to_many_label
qt: send tab: show "pay to many" label
2025-11-12 15:29:27 +01:00
ghost43
d87f9e9a44 Merge pull request #10295 from SomberNight/202510_proto16
electrum protocol: add support for 1.6, but keep supporting 1.4
2025-11-07 16:42:11 +00:00
f321x
8fabad4b51 qt: send tab: show "pay to many" label
This changes the "Pay to" label to "Pay to many" if the user enables the
"Pay to many" option and aligns it at the top of the payto_e instead of
moving ot to the center when the payto_e expands.
2025-11-04 10:21:09 +01:00
f321x
c2068a4e4b qt: add text to toolbar button
The toolbar button is very small and some users probably don't even
notice it. As we have lots of space in the toolbar anyways i think it
makes sense to add some text to it to make it more visible and easier to
click. Maybe this is also useful for screen readers.
2025-11-04 09:54:29 +01:00
SomberNight
cd3173a289 interface: extend client to be able to support a range of protocols 2025-11-03 16:50:38 +00:00
ghost43
41378e1c91 Merge pull request #10287 from f321x/fix_cake_diagram
qt: allow opening BalanceDialog if warning is set and balance is 0
2025-10-31 13:45:08 +00:00
f321x
fb4b744142 qt: remove outdated help string in SendTab
The amount edit box is not turning red anymore if the amount is higher
than the wallet balance, so this string can be removed.
Alternatively it could be made red again but seems like nobody missed
it.
2025-10-29 18:17:06 +01:00
f321x
6484947485 qt: allow opening BalanceDialog if warning
Allow to open the BalanceDialog, by clicking on the Pie Diagram in the
bottom left corner of the main window, if there is an active warning,
even if the wallets balance is 0. Right now the user can see the
warning icon for the lighting channel reserve, but cannot click on the
icon to read the actual warning if there is no balance in the wallet.
2025-10-29 10:50:56 +01:00
f321x
c816987164 android: qr scanner: add emoji to clipboard string
The string is not translated and might not be accessible for non-english
speakers, even though its relatively self-explanatory i think adding
this emoji makes it more accessible.
2025-10-28 14:32:04 +01:00
f321x
f2aa4404ad qt: fix ServerWidget
The ServerWidget was not working properly, when switching from "Manual
Mode" to "Auto Connect" the change wouldn't get saved as it depended on
having a correct server string entered (which isn't neccessary for Auto
Connect).
Also makes the widget behave more sane by cleaning the server input if
Auto Connect is enabled and switching to Manual Mode if the user
manually selects a server.

Update the ServerWidget every time it is shown (on initialization and
also when the user opens it again or switches between network dialog
tabs).
This will clean it up if the user has entered some invalid server and
closes it, otherwise this server would stay in the input field until the
application is restarted.

The list of servers in the ServerWidget allows the user to right click
and 'Use as server' on the servers in the list, however internally it
was handled differently than what the user would expect when clicking on
'Use as server'. E.g. if the user selects a server in autoconnect mode
it would still stay in autoconnect mode so the server could switch again
to another server any time? Now it will also change the mode to manual
(or stay in single server mode if that was selected before), making it
clear that this server will stay selected.

If the user clicks on "Follow this branch" the connect mode will get changed to
autoconnect as internally we connect to a random interface on this
branch.
2025-10-27 18:46:36 +01:00
dulanting
08fd2de003 chore: fix comment for electrum/gui/qt/main_window.py
Signed-off-by: dulanting <dulanting@outlook.jp>
2025-10-13 16:26:50 +08:00
SomberNight
f832c33d76 qt: main_window.confirm_tx_dialog: rm dead code 2025-10-09 14:36:15 +00:00
SomberNight
af6715040c lnurlw: follow-up: adapt to recent lnworker.get_bolt11_invoice refactor 2025-10-03 02:12:04 +00:00
SomberNight
ef8d53c46a lnurlw: follow-up: fix android edge-to-edge layout padding
as per https://github.com/spesmilo/electrum/pull/9993#issuecomment-3228252596
2025-10-03 02:11:43 +00:00
SomberNight
7d0ac64d06 Merge remote-tracking branch 'spesmilo/pr/9993': lnurl-withdraw
ref https://github.com/spesmilo/electrum/pull/9993
2025-10-02 23:34:40 +00:00
f321x
286fc4b86e lnworker: enforce creation of PaymentInfo for b11
Enforce that the information used to create a bolt11 invoice using
`get_bolt11_invoice()` is similar to the related instance of PaymentInfo
by requiring a PaymentInfo as argument for `get_bolt11_invoice()`.
This way the invoice cannot differ from the created PaymentInfo.
This allows to use the information in PaymentInfo for validation of
incoming htlcs more reliably.

To cover all required information for the creation of a b11 invoice the
PaymentInfo class has to be extended with a expiry and
min_final_cltv_expiry. This requires a db upgrade.
2025-09-30 09:54:35 +02:00
ghost43
de7612b3b1 Merge pull request #10216 from SomberNight/202509_adb_spv
adb: change API of util.TxMinedInfo: height() is now always SPV-ed
2025-09-24 13:50:14 +00:00