Commit Graph

8503 Commits

Author SHA1 Message Date
f321x
8b15d64dc9 fix: prevent KeyError if _fail_swap gets called multiple times
If `_fail_swap()` gets called multiple times (e.g. from callbacks) this
would race a `KeyError` as the swap got already popped from
`self._swaps`.
In theory `_fail_swap` unregisters itself from the lnwatcher callback
but the callback may is scheduled multiple times before it has the
chance to unregister itself.
2025-06-11 11:37:24 +02:00
ThomasV
660b97c906 follow-up prev: show the plugin dialog 2025-06-10 11:32:39 +02:00
f321x
df66126389 disable "Enable" button of unavailable plugins
this changes PluginsDialog to disable the "Enable" button of plugins
that are missing dependencies (e.g. amodem) instead of not showing them
at all. A tooltip is shown explaining the user why the plugin is
disabled.
2025-06-10 11:19:55 +02:00
ThomasV
630124136e plugins dialog: fix is_available, do not show plugins that are not available 2025-06-10 11:02:18 +02:00
ThomasV
86f3eec8e6 fix user-facing exception refreshing history after swap is refunded
(txbatcher first adds the tx unsigned)
2025-06-10 10:44:10 +02:00
ThomasV
15e77d2d80 Merge pull request #9929 from f321x/swapserver_icon
qt: show deterministic colors for swapservers
2025-06-10 09:57:36 +02:00
ThomasV
e6ba90f219 Merge pull request #9928 from f321x/swap_fee_slider
swaps: use eta:2 instead of config fee policy in qml, disable qt fee slider on reverse swaps
2025-06-10 09:51:00 +02:00
f321x
6af54866c9 qt: show deterministic colors for swapservers
shows a little color icon which generated deterministically from
the server pubkey for easier differentiation.
2025-06-10 09:49:03 +02:00
ThomasV
2b8a0d5a1d Merge pull request #9927 from SomberNight/202506_gui_swapserver_pubkey
gui: "Choose Swap Provider" screen: show hex pubkey, and longer prefix
2025-06-09 17:53:20 +02:00
f321x
37181cd3a8 disable qt swap fee slider on reverse swaps, change eta
disables the fee slider in the swap dialog for reverse swaps as the tx
fee for claiming is not configurable by the user. Also replaces calls to
`sm.get_swap_tx_fee()` with `sm.get_fee_for_txbatcher()` as this is the
correct fee estimate for claim transactions, instead of the config fee
eta used by `get_swap_tx_fee()`.
2025-06-09 17:36:38 +02:00
SomberNight
dbb9673139 interface: faster chain resolution: add headers_cache
We try to predict the next headers the interface will ask for,
and request them ahead of time, to be kept in the headers_cache.

This saves network latency/round-trips, for a bit more memory usage
and in some cases for more bandwidth.
Note that due to PaddedRSTransport.WAIT_FOR_BUFFER_GROWTH_SECONDS,
latency saved here can be longer than "real" network latency.

This speeds up
- binary search greatly,
- backwards search to a small degree
  (although not that much as its algorithm should be changed a bit to make it cache-friendly)
- catch-up greatly, if it's <10 blocks behind

What remains is to speed up catch-up in case we are behind by many thousands of block.
That behaviour is left unchanged here. The issue there is that we request chunks sequentially.
So e.g. 1 chunk (2016 blocks) per 1 second.
2025-06-09 15:36:04 +00:00
f321x
4849d4d770 fix: use eta:2 as funding tx fee policy in qml swap
qml used the user config fee policy for the forward swap onchain funding
tx which can be too high or low, depending on what transactions the user
did previously with the wallet. Setting it to eta:2 ensures that the
funding tx is paying a sane fee.
2025-06-09 17:15:09 +02:00
SomberNight
becb912397 gui: "Choose Swap Provider" screen: show hex pubkey, and longer prefix
- makes it consistent between the qml and qt guis that now both show the hex pubkey
  - previously qml was showing npub
- don't truncate to first 10 chars, as that's still easy to bruteforce
  - the qt gui has space to display the full pubkey (64 hex chars)
    and can use the TreeWidget's columns to truncate as needed
  - qml has less space, truncate to 32 hex chars there (128 bits should be enough against bruteforce)
2025-06-09 15:12:32 +00:00
SomberNight
af11ebb3c3 interface: _search_headers_backwards: add an assert 2025-06-09 13:12:35 +00:00
SomberNight
b01e69cf45 interface: split request_chunk method 2025-06-09 13:12:31 +00:00
SomberNight
57bb98dc7f blockchain: parameterise magic number 2016 as CHUNK_SIZE 2025-06-09 13:11:59 +00:00
SomberNight
27599ac537 interface: small clean-up. intro ChainResolutionMode.
- type hints
- minor API changes
- no functional changes
2025-06-06 16:42:15 +00:00
ghost43
2b5147eb4d Merge pull request #9921 from f321x/fix_plugin_aiohttp_client_session
fix: use make_aiohttp_session for plugin zip download
2025-06-06 16:20:56 +00:00
f321x
18e241edf0 fix: use make_aiohttp_session for plugin dl 2025-06-06 17:24:41 +02:00
ThomasV
d3921ca25b fix lnwatcher callback (follow-up 5610a94537) 2025-06-06 17:18:09 +02:00
ghost43
d1c5cafcdd Merge pull request #9898 from f321x/windows_disable_screenshot
qt: windows: protect against screenshots and screen recordings
2025-06-06 13:42:29 +00:00
accumulator
6b928c5032 Merge pull request #9916 from f321x/fix_flaky_swapserver_list_qml
fix: use single long lived swap transport in qeswaphelper
2025-06-06 14:50:09 +02:00
Sander van Grieken
89cab31b81 qml: swaphelper: update offer model properly 2025-06-06 14:38:24 +02:00
f321x
3a39abc415 fix: use single long lived transport in qeswaphelper
changes qeswaphelper to shate a single, long lived transport instance
instead of opening new transports to do swaps and fetch offers.
This allows to continuosly fetch offers, so events which get returned
later by slow relays don't get missed and the fee values stay updated.
Also fixes a race causing the list to miss some swapservers, as the
current implementation fetches only until
`swap_manager.is_initialized()` is set, which will get set as soon as an
event of the configured swapserver is received. So if the event of the
configured swapserver is received as first, all server events coming in
after it would get ignored.
2025-06-06 14:38:11 +02:00
Sander van Grieken
0a6f6ab006 qml: use color for accounting addresses 2025-06-06 13:38:48 +02:00
ThomasV
cd2f52e2d9 follow-up 5610a94537 2025-06-06 12:35:41 +02:00
ThomasV
5610a94537 fix #9856 2025-06-06 12:17:21 +02:00
ThomasV
1bf1de36cb txbatcher:
- add base_tx to wallet before broadcasting
 - remove base_tx in find_base_tx, it is local
 - add unit test in test_tx_batcher
2025-06-06 10:16:32 +02:00
f321x
ca9c4777d8 windows: protect against screenshots and screen recordings 2025-06-06 09:29:01 +02:00
ThomasV
6711b65b8c Qt: use color for accounting addresses 2025-06-06 09:18:12 +02:00
ThomasV
a0636e8f33 lnworker: fix timestamp in get_lightning_history 2025-06-06 08:46:21 +02:00
ThomasV
420cd1e5ed make wallet stop and restart-able 2025-06-05 19:12:47 +02:00
SomberNight
7fa204f16b qml: fix setting config.GUI_QML_SET_MAX_BRIGHTNESS_ON_QR_DISPLAY
follow-up https://github.com/spesmilo/electrum/pull/9321
2025-06-05 16:37:59 +00:00
ThomasV
eaa402dab6 daemon: do not set CURRENT_WALLET if the -w option was passed
This was the previous behaviour with gui_last_wallet.
2025-06-05 16:57:15 +02:00
Sander van Grieken
e3ccee6d63 qt: channel closed dialog is not an error 2025-06-05 12:37:23 +02:00
ThomasV
e8113d684c Merge pull request #9852 from accumulator/qml_fix_forceclose_exception
qml: fix assumption history item is onchain when history item has no timestamp
2025-06-05 09:58:48 +02:00
ThomasV
8330c72b65 Merge pull request #9906 from spesmilo/maybe_complete_wallet_path
CLI: complete wallet_path
2025-06-05 09:18:02 +02:00
ThomasV
9afd2fa098 Merge pull request #9911 from f321x/fix_swap_exception_send_change_to_lightning
fix: exceptions when sending change to lightning
2025-06-05 09:15:21 +02:00
ThomasV
85c3c77096 CLI: make 'wallet_path' relative to wallets dir
If the wallet_path passed to the RPC is a simple filename,
interpret it as relative to the user wallets directory,
rather than to the current working directory.

This is a breaking change, it might affect existing scripts
2025-06-05 09:06:29 +02:00
ThomasV
37914d5af0 cmdline: use 'wallet_path' argument to pass wallet_path 2025-06-05 09:06:29 +02:00
Sander van Grieken
044ea1f4f6 submarine_swaps: imports, whitespace 2025-06-04 19:47:30 +02:00
f321x
5ad1b4b5dd fix: exceptions with send change to lightning 2025-06-04 17:40:04 +02:00
ThomasV
2024fa4507 Merge pull request #9902 from SomberNight/202506_base64_trailing_garbage
base64.b64decode: always set validate=True
2025-06-04 14:59:20 +02:00
ThomasV
ee2c3e07b8 Merge pull request #9896 from f321x/nwc_receive_only_connections
plugin-nwc: don't announce spending methods if spending limit is 0
2025-06-04 14:51:53 +02:00
ThomasV
d8c73eab17 Merge pull request #9904 from f321x/fix_ToU_workaround
fix: prevent opening new window if ToU haven't been accepted
2025-06-04 12:46:45 +02:00
ThomasV
69545f08ca list_wallets: fix wallet path (follow-up 902ec09791) 2025-06-04 10:46:45 +02:00
f321x
6c7d8e8f86 fix: prevent opening new window if ToU haven't been accepted
prevents the creation of new Qt windows if the terms of use have not
been accepted yet. This is to prevent bypassing the terms of use by
starting the wallet a second time which would then skip the ToU.
2025-06-04 09:48:00 +02:00
SomberNight
3e4601c61d base64.b64decode: always set validate=True
Notably verifymessage and decrypt(message) were silently ignoring trailing garbage
or inserted non-base64 characters present in signatures/ciphertext.
(both the CLI commands and in the GUI)
I think it is much cleaner and preferable to treat such signatures/ciphertext as invalid.

In fact I find it surprising that base64.b64decode(validate=False) is the default.
Perhaps we should create a helper function for it that set validate=True and use that.
2025-06-03 18:58:05 +00:00
SomberNight
902ec09791 daemon: re config.CURRENT_WALLET: wallet_key MUST NOT be used as path 2025-06-03 15:08:03 +00:00
ThomasV
6373269b42 Merge pull request #9895 from accumulator/qml_network_settings_update_fix
qml: fix updating network settings
2025-06-03 14:43:43 +02:00