1
0
Commit Graph

19714 Commits

Author SHA1 Message Date
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
SomberNight
aab22a237b ln: require LnFeatures.OPTION_CHANNEL_TYPE as bolts now mandate it
This simplifies some code.

following 9d456b1c4a
2025-12-18 16:43:19 +00:00
SomberNight
85a45f9b1f lnutil: rm remnants of old unsupported original ANCHOR_OUTPUTS option 2025-12-18 16:09:49 +00:00
accumulator
519944c06e Merge pull request #10377 from accumulator/qml_process_request_status_update_via_eventloop
qml: QERequestDetails process request update via event loop.
2025-12-18 16:48:40 +01:00
ghost43
877dce551b Merge pull request #10375 from accumulator/qml_current_wallet_update
qml: store current wallet when switching to already open wallet
2025-12-18 14:52:12 +00:00
SomberNight
cb3c286fe2 network: disconnected servers: do not filter out bookmarked raw ":t"
In the GUI, when displaying the list of disconnected servers, we were
filtering to only ":s" servers. Instead now we also show ":t" servers
if they are bookmarked.

Also, if bookmarked, we also show disconnected .onion servers, even
when not using a Tor proxy.

fixes https://github.com/spesmilo/electrum/issues/10374
2025-12-18 14:27:54 +00:00
SomberNight
21fa6114eb network: dedupe qt/qml get_disconnected_server_addrs code 2025-12-18 14:07:43 +00:00
ghost43
e025f1d17b Merge pull request #10376 from accumulator/fix_10335
qt: don't store python tuple in a qt QVariant.
2025-12-18 12:54:29 +00: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
Sander van Grieken
0d812500e1 qml: QERequestDetails process request update via event loop.
This allows backend to process all callbacks before we start querying the payment database

should fix #10116
2025-12-18 12:40:53 +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
Sander van Grieken
f2e6243e19 qt: don't store python tuple in a qt QVariant.
This is an educated guess in fixing #10335, Qt can be very picky w.r.t. wrapping types,
and we have additional complexity in the PyQt/SIP layer.

as the address index is only used to facilitate sorting, convert address index tuple
to a sortable string instead.

This assumes uniformity in the length of address indexes.
2025-12-18 10:59:56 +01:00
Sander van Grieken
7d5d51975f qml: store current wallet when switching to already open wallet 2025-12-18 09:48:09 +01:00
Sander van Grieken
fffcf4a90b qml: add FeePicker manual fee/feerate input validators 2025-12-18 08:32:46 +01:00
Sander van Grieken
7ef605ee5c qml: allow manual editing of fee/feerate
also improve warning box styling consistency across finalizers,
add CPFP new feerate > old feerate check,
add relayfee checks for CPFP, DSCancel,
proper warning string for no dynamic fee estimates
2025-12-18 08:32:46 +01:00
Sander van Grieken
4cab0ceddd qml: don't catch-all when making tx for sweep finalizer 2025-12-18 08:31:09 +01:00
ghost43
308ffb1f4c Merge pull request #10318 from SomberNight/202511_lnsweep_keepwatching
lnsweep: lnwatcher needs to keep_waiting for pending hold_invoice
2025-12-18 00:54:14 +00:00
Sander van Grieken
72daff3ae4 qml: improve HelpDialog styling
remove misalignment between pane and dialog, add bottom padding
2025-12-17 16:50:59 +01:00
Sander van Grieken
5a49161ae6 qml: fix FeePolicy regression
ref 840243e029
2025-12-17 15:50:04 +01:00
ThomasV
e4831c823a Merge pull request #10370 from f321x/tc_disable_signing_in_preview
qt: trustedcoin: only allow signing with broadcast
2025-12-17 15:16:22 +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
SomberNight
f339a6b76d lnwatcher: follow-up prev 2025-12-17 10:23:16 +00:00
f321x
a105c50029 qt: trustedcoin: only allow signing with broadcast
Only allow signing a transaction if it also gets broadcast by disabling
the signing and broadcast button of the preview dialog when creating a
new tx. Makes it slightly less trivial to cheat with the fees.
2025-12-16 13:54:08 +01:00
SomberNight
5e53f82bc6 tests: lnpeer: simplify MockNetwork: rm dead code
not needed since 9224404108
2025-12-15 15:38:16 +00:00
SomberNight
166aa50a65 README: tests: add note about pytest-xdist 2025-12-15 15:13:55 +00:00
SomberNight
7e1fd008f0 lnsweep: lnwatcher needs to keep_watching if htlc in dont_settle_htlcs
If RHASH is in lnworker.dont_settle_htlcs, we should not reveal
the preimage. But also, we should not disregard the htlc either.

E.g. during a JIT channel open, payment going A->B->C,
C would release the preimage to B (lsp) to cover the costs of the
JIT channel-open. If the upstream A->B channel gets force-closed, B should
only pull the HTLC's funds if he is sure he can forward them to C.

lnwatcher needs to keep watching (i.e. wait) until the RHASH gets removed from
lnworker.dont_settle_htlcs, or until the CLTV of the HTLC expires.
2025-12-15 14:53:50 +00:00
ghost43
3093e4c7f6 Merge pull request #10365 from f321x/i18n_timelock_recovery
plugin: timelock recovery: more i18n
2025-12-15 13:16:43 +00:00
f321x
095debcded plugin: timelock recovery: more i18n 2025-12-15 11:52:57 +01:00
f321x
e0b835eee6 tests: rm TestPeerDirect::test_dont_settle_htlcs
The new test
TestPeerForwarding::test_dont_settle_htlcs_receiver_and_forwarder covers
the receiver as well as the forwarder. So this unittest becomes obsolete
as it only tests the receiver.
2025-12-15 10:36:14 +01:00
f321x
cd1157ec14 tests: lnpeer: test_dont_settle_htlc_receiver_and_forwarder 2025-12-15 10:36:12 +01:00
f321x
060cbff8da lnpeer: dont remove from dont_settle_htlcs when failing
Don't remove a payment hash from LNWallet.dont_settle_htlcs and
dont_expire_htlcs if we are failing it.
We might see another htlc with the same payment hash and
should still not settle or expire it.
2025-12-15 10:35:29 +01:00
ThomasV
bd735c645d Merge pull request #10359 from f321x/lnpeer_remove_zlib_compression
lnpeer: remove zlib encoding support from gossip
2025-12-13 11:18:22 +01:00
ThomasV
1d98d08f5b Merge pull request #10360 from f321x/qt_fix_lightning_icon_gossip_sync
qt: make ElectrumWindow.lightning_button wider
2025-12-13 11:15:51 +01:00
ThomasV
47d9ffb103 Merge pull request #10354 from f321x/fix_10350
lnworker: prevent creation of PaymentInfo with 0 exp
2025-12-13 11:05:46 +01:00
f321x
9906eb42ac lnpeer: forwarding: dont release preimage if dont_settle_htlc
If a payment hash is in LNWallet.dont_settle_htlcs the preimage
shouldn't be released even when just forwarding.
2025-12-12 15:44:48 +01:00
f321x
2f2340d69f lnworker: prevent creation of PaymentInfo with 0 exp
In some parts of the application 0 (sec) == no expiry, however we
use `LN_EXPIRY_NEVER` (100 years) instead of 0 for lightning invoices.

This replaces a 0 second expiry with `LN_EXPIRY_NEVER` in
`LNWallet.create_payment_info()` to prevent htlcs for no-expiry invoices
from getting failed incorrectly (which the assert prevented)
and fix the assertion error in #10350.

Fixes #10350.

# Conflicts:
#	electrum/lnworker.py
2025-12-12 09:58:22 +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
ghost43
0b886cf7a8 Merge pull request #10272 from accumulator/timelock_recovery_destination_validation
timelock_recovery: recovery destination checks for address is_mine or script output
2025-12-11 19:08:09 +00:00
ghost43
783cd56046 Merge pull request #10356 from f321x/remove_newline_rawtx
tx: replace all whitespace chars in raw tx (convert_raw_tx_to_hex)
2025-12-11 18:49:13 +00:00
ghost43
ef240052af Merge pull request #10332 from SomberNight/202511_p4a_hacks
android build: update openssl, and switch cryptography->pycryptodomex
2025-12-11 17:47:52 +00:00
SomberNight
5b67f21bc4 android: add run-time patch to make pycryptodomex work
to work around https://github.com/kivy/python-for-android/issues/1866 :

> PyCryptodome >=3.6.0 crashes at runtime (since commit f5aa2c1618). So actually the currently pinned version in the recipe does not work:
> 80e4f059c1/pythonforandroid/recipes/pycryptodome/__init__.py (L5)
>
> The issue at runtime is with ctypes.
>
>
> Say I have a main script that just does the following (95ccce7ae8/lib/Crypto/Util/_raw_api.py (L200)):
> ```
>  import ctypes
>  ctypes.pythonapi.PyObject_GetBuffer
>  ```
>
> This works with cpython on my laptop, but with the p4a-compiled python on Android it fails:
>
> ```
> 06-14 19:06:27.053 15246 15274 I python  : Android kivy bootstrap done. __name__ is __main__
> 06-14 19:06:27.053 15246 15274 I python  : AND: Ran string
> 06-14 19:06:27.053 15246 15274 I python  : Run user program, change dir and execute entrypoint
> 06-14 19:06:27.092 15246 15274 I python  : Traceback (most recent call last):
> 06-14 19:06:27.092 15246 15274 I python  :   File "/home/user/wspace/electrum/.buildozer/android/app/main.py", line 84, in <module>
> 06-14 19:06:27.093 15246 15274 I python  :   File "/home/user/wspace/electrum/.buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/Lib/ctypes/__init__.py", line 369, in __getattr__
> 06-14 19:06:27.093 15246 15274 I python  :   File "/home/user/wspace/electrum/.buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/Lib/ctypes/__init__.py", line 374, in __getitem__
> 06-14 19:06:27.094 15246 15274 I python  : AttributeError: undefined symbol: PyObject_GetBuffer
> ```
>
> I have also tried to access some other attributes of `ctypes.pythonapi`, such as `Py_IncRef`, which raises the same exception.

---

Unclear if the issue still affects newer p4a: upstream seems to think it's fixed, but there multiple comments in the thread saying otherwise. Anyway, rebasing p4a has other blockers atm.
2025-12-11 17:42:45 +00:00
SomberNight
cfa052bc86 android build: switch from "cryptography" to "pycryptodomex"
We had been using an ancient version of "cryptography" so far in our p4a fork,
however it is not compatible with OpenSSL 3.0. (Previously we were building it with OpenSSL 1.1)

Bumping "cryptography" is difficult, as building new versions of it from source requires a full rust toolchain.

Instead, this commit switches to "pycryptodomex", as a replacement, which is much easier to build from source.
2025-12-11 17:42:42 +00:00
SomberNight
2d4d4dbdc8 android build: bump openssl (1.1.1w -> 3.0.18) 2025-12-11 17:42:29 +00:00
SomberNight
e188102eb3 build: bump electrum-aionostr to 0.1.0 2025-12-11 17:35:22 +00: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
SomberNight
16363cc3d9 transaction: tx_from_any: follow-up: only rm whitespaces from strings 2025-12-11 16:24:31 +00:00
SomberNight
9af0195f60 transaction: psbt.from_raw_psbt: clarify hex input must be str
no functional change (besides incorrect input now raising a different exception)

```
>>> bytes.fromhex(b"deadbeef")
TypeError: fromhex() argument must be str, not bytes
```
2025-12-11 15:23:33 +00:00
f321x
b4fc39ca5f test: lnpeer: add test_decode_short_ids 2025-12-11 15:53:30 +01:00
f321x
1ebb937d46 lnpeer: decode_short_ids: check length of short ids
- if `encoded_short_ids` does not decode into a whole number of `short_channel_id`:
  - MAY send a `warning`.
  - MAY close the connection.
0cf21511a7/07-routing-gossip.md (L674)

# Conflicts:
#	electrum/lnpeer.py
2025-12-11 15:44:11 +01:00