1
0
Commit Graph

19510 Commits

Author SHA1 Message Date
f321x
380d7edea2 lnpeer: remove support for zlib compression
Must not be used anymore according to bolt 7:
0cf21511a7/07-routing-gossip.md (L600)
2025-12-11 15:43:45 +01: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
ghost43
4d39a198cc Merge pull request #10353 from f321x/lnurlw_exc
lnurlw: catch UserCancelled and handle 'null' minWithdrawable
2025-12-10 16:21:45 +00: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
ghost43
6ceb4ad71f Merge pull request #10351 from f321x/jit_htlc_switch_fixes
lnpeer/lnutil: fail mpp if we didn't signal mpp in invoice
2025-12-10 15:56:23 +00:00
SomberNight
745318d1ec wallet_db: convert_version_66: trivial simplification 2025-12-10 15:53:17 +00:00
f321x
aa47a960a7 ledger: throw UserFacingException for OSError
Throws UserFacingException if the communication with the ledger fails
due to an OSError. This happens e.g. if the Bitcoin app has been closed.
We shouldn't get crash reports for errors due to disconnection.
2025-12-10 16:48:17 +01:00
ghost43
8e5780b98c Merge pull request #10346 from f321x/fix_channel_removal_assert
lnchannel: allow deleting unfunded incoming channels
2025-12-10 15:00:07 +00:00
f321x
c34efce984 lnchannel: allow deleting unfunded incoming channels
We tried to delete incoming channels that didn't get funded after
lnutil.CHANNEL_OPENING_TIMEOUT, however an assert prevented this:

```
  3.63 | E | lnwatcher.LNWatcher.[default_wallet-LNW] | Exception in check_onchain_situation: AssertionError()
Traceback (most recent call last):
  File "/home/user/code/electrum-fork/electrum/util.py", line 1233, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/lnwatcher.py", line 117, in check_onchain_situation
    await self.update_channel_state(
    ...<5 lines>...
        keep_watching=keep_watching)
  File "/home/user/code/electrum-fork/electrum/lnwatcher.py", line 135, in update_channel_state
    chan.update_onchain_state(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        funding_txid=funding_txid,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        closing_height=closing_height,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        keep_watching=keep_watching)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/lnchannel.py", line 341, in update_onchain_state
    self.update_unfunded_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/user/code/electrum-fork/electrum/lnchannel.py", line 382, in update_unfunded_state
    self.lnworker.remove_channel(self.channel_id)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/lnworker.py", line 3244, in remove_channel
    assert chan.can_be_deleted()
           ~~~~~~~~~~~~~~~~~~~^^
AssertionError
```
2025-12-10 13:20:32 +01: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
f321x
4bd013ef10 lnurlw: accept "null" minWithdrawable in response
Accept a `null` value as response for the `minWithdrawable` field in the
lnurlw response. Some servers seem to set this to `null` instead of 0
when having no minimum withdrawal amount.
2025-12-10 10:50:01 +01:00
f321x
7c01d9db75 tests: lnpeer: add test_reject_mpp_for_non_mpp_invoice 2025-12-10 10:36:41 +01:00
f321x
183d426e93 lnpeer: fail htlcs if we get unwanted mpp
Fail incoming htlcs if we receive a payment consisting of multiple parts
if we signaled to not want mpp in the invoice.
2025-12-10 10:36:39 +01:00
f321x
125a921cc4 lnworker: add invoice features to PaymentInfo class
Adds the invoice features to the `PaymentInfo` class so we can check if
the sender respects our requested features (e.g. if they tried to send
mpp if we requested no mpp).
2025-12-10 10:36:31 +01:00
f321x
5be598b808 lnworker: use channel_id instead of scid in ReceivedMPPHtlc
Store the channel id instead of the scid in ReceivedMPPHtlc.
The scid can be None, in theory even for multiple channels at the same
time. Using the channel_id which is always available and unique seems
less error prone at the cost of temporarily higher storage requirements
in the db for the duration of the pending htlcs.

Alternatively we could use the local scid alias however using the
channel_id seems less complex and leaves less room for ambiguity.
2025-12-09 14:44:11 +01:00
f321x
8a88ebe6bc lnworker: add type assert to get_channel_by_short_id
Prevents accidentally passing None if channel.short_id is not set yet
2025-12-09 14:44:09 +01:00
SomberNight
6d1e8e8619 lnworker: write rationale for PaymentInfo class in docstring
ref 4ad9caddab
ref f08e5541ae
2025-12-08 15:54:37 +00:00
ThomasV
4d3ead36c9 Merge pull request #10348 from f321x/fix_jit_channel_openings_regtest
lnpeer: deduct jit channel fees from total amount
2025-12-06 11:11:42 +01:00
ThomasV
da998150ac lnpeer: deduct JIT fees also for trampoline 2025-12-06 10:33:24 +01:00
f321x
fb566eb59e lnpeer: deduct jit channel fees from total amount
Deduct the just in time channel opening fees from the total amount so
htlcs don't get timed out if they come from a just in time channel with
opening fee.

Related: https://github.com/spesmilo/electrum/pull/9584
2025-12-06 10:14:07 +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
ghost43
07b59631bf Merge pull request #10349 from SomberNight/202512_openalias
openalias: always require DNSSEC validation, and fix a qml regression
2025-12-05 17:09:19 +00:00
SomberNight
cf8c243bd9 dnssec: log warning if dependency is missing
Calling dnssec.query() with missing "cryptography" dep behaves the same as if DNSSEC validation failed: validated=False will be returned.
When used for openalias, we mandate validated=True.
2025-12-05 17:06:50 +00:00
SomberNight
cdcac8cb09 openalias: always enforce DNSSEC validation succeeds 2025-12-05 17:06:41 +00:00
Sander van Grieken
23b6465780 onion_message: verify ONION_MESSAGE feature on peer before forwarding 2025-12-05 17:53:03 +01:00
Sander van Grieken
fb58d210e5 onion_message: fix forwarding, blinding was renamed path_key
followup 130af59760
2025-12-05 17:51:19 +01: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
ghost43
f3dccc8e4b Merge pull request #10347 from accumulator/gossip_cln_feature_workaround
electrum refuses to exchange gossip with CLN nodes, due to missing feature OPTION_CHANNEL_TYPE_OPT
2025-12-05 15:18:55 +00:00
Sander van Grieken
3e4f80aa06 electrum refuses to exchange gossip with CLN nodes, due to missing feature OPTION_CHANNEL_TYPE_OPT.
moving OPTIONAL_CHANNEL_TYPE_OPT to BASE_FEATURES
2025-12-05 15:51:16 +01:00
ThomasV
55cc27d27e Test JIT channels: check that lnpay success is true.
This test fails since 0f314d1dd9
2025-12-05 12:05:37 +01:00
ThomasV
cd1d384db5 lnwatcher: remove address callback if keep_watching is False
(follow-up 9b72dc297b)
2025-12-05 11:53:24 +01:00
ThomasV
40729aa0e5 test accounting_addresses: stop alice before requesting, because we need a new session.
(follow-up 9b72dc297b)
2025-12-05 11:31:27 +01:00
SomberNight
ef0e4e02b7 txbatcher: add TODOs re nLocktime block-height vs timestamp confusion
seems harmless atm but some rethinking is needed and checks should be added
2025-12-04 15:32:46 +00:00
ghost43
1eb69c90dd Merge pull request #10341 from SomberNight/202512_nwc_dontmutateevent
plugins: nwc: don't mutate aionostr Event
2025-12-04 15:24:40 +00:00
ThomasV
9b72dc297b lnwatcher: remove rearly return that breaks accounting_addresses
This reverts 6ffaa55.
Also, in regtests, add a check that fails if accounting_addresses are broken.
2025-12-04 10:26:01 +01:00
SomberNight
75ac8bcee1 plugins: nwc: don't mutate aionostr Event
I want to change the Event class to be immutable.
2025-12-04 00:47:32 +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
ThomasV
cb7e550abb follow-up prev commit 2025-12-02 10:38:10 +01:00
SomberNight
14fd85f935 json_db: fix StoredDict.__delitem__() to work similarly to .pop()
follow-up https://github.com/spesmilo/electrum/pull/10233 ("jsondb pointers")
2025-12-01 19:42:47 +00:00
SomberNight
afc87fea9a tests: json_db: add more asserts for clarity 2025-12-01 19:33:14 +00:00
SomberNight
1119cb9a75 json_db: add some type hints and asserts
- fix some incorrect type hints
- add many new type hints
- add asserts re types

no functional changes intended
2025-12-01 19:29:51 +00:00
f321x
df612fa010 lnworker: allow overwriting amount of sent payment info
Allows replacing a saved `PaymentInfo` of `SENT` direction if the old
one is not yet paid.
This allows the user to retry paying a 0 amount invoice with different
amount if the previous attempt failed.
2025-12-01 18:39:59 +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
SomberNight
828fc569c9 commands: version_info: include openssl version 2025-11-30 06:03:08 +00:00
ghost43
d17bb016ef Merge pull request #10330 from SomberNight/202511_lnsweep_refactor_preimage
lnsweep: factor out "maybe_reveal_preimage_for_htlc"
2025-11-28 16:57:05 +00:00
SomberNight
ef8fd03e8f lnsweep: factor out "maybe_reveal_preimage_for_htlc"
no functional changes
2025-11-28 15:55:35 +00: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