1
0
Commit Graph

562 Commits

Author SHA1 Message Date
ThomasV
18d7db12da Change warning shown on first channel creation
Qt: if created channel is not recoverable, show channel backup after creation
2021-03-24 10:24:14 +01:00
SomberNight
2c047c72e1 (trivial) just add some TODOs 2021-03-23 17:30:40 +01:00
ThomasV
a5fea043d1 Allow user to remove onchain backups. 2021-03-23 14:41:37 +01:00
ThomasV
f7d2a33d45 set initial trampoline fee level to 1 unless we are testing 2021-03-22 17:04:01 +01:00
ThomasV
0f4297cfa8 fix direct payment to trampoline node 2021-03-22 13:17:50 +01:00
ThomasV
f8804b29c9 (minor) fix mutable default value 2021-03-22 11:50:01 +01:00
Benoit Verret
f731c38293 Minor style changes 2021-03-21 00:36:23 -04:00
ThomasV
aad392f6ff lnworker: filter active channels in create_routes_for_payment 2021-03-20 13:53:46 +01:00
ThomasV
0121cbcbbe pay_to_route: raise PaymentFailure in case of dropped peer, so that we reset payment status 2021-03-20 10:12:49 +01:00
SomberNight
d8352f1a0a lnworker: nicer logs/error msgs for payment failure
try to decode onion error and log it in human-readable form
2021-03-19 19:13:50 +01:00
ThomasV
2fee920f43 On Android, if channels are not recoverable, display channel backup when a new channel is created.
Remove the 'android_backups' setting, which was unpractical.
2021-03-19 13:17:58 +01:00
ThomasV
64a931f21e Deterministic NodeID:
- use_recoverable_channel is a user setting, available
   only in standard wallets with a 'segwit' seed_type
 - if enabled, 'lightning_xprv' is derived from seed
 - otherwise, wallets use the existing 'lightning_privkey2'

Recoverable channels:
 - channel recovery data is added funding tx using an OP_RETURN
 - recovery data = 4 magic bytes + node id[0:16]
 - recovery data is chacha20 encrypted using funding_address as nonce.
   (this will allow to fund multiple channels in the same tx)

GUI:
  - whether channels are recoverable is shown in wallet info dialog.
  - if the wallet can have recoverable channels but has an old node_id,
    users are told to close their channels and restore from seed
    to have that feature.
2021-03-19 10:17:02 +01:00
ThomasV
8a051dcd76 lnworker: use booleans for enable_htlc_settle, enable_htlc_forwarding 2021-03-18 07:48:30 +01:00
ThomasV
e954bfaa54 request_force_close: close and reopen existing peer connection,
because channel_reestablish cannot be sent twice in the same session
2021-03-17 15:36:21 +01:00
ThomasV
1c8c236933 channels_with_funds: self._channels -> self.channels 2021-03-17 13:50:57 +01:00
ThomasV
8d8f078544 Merge pull request #7107 from bitromortac/2103-trampoline-mpp-single
mpp_split: use single nodes for mpp payments over trampoline
2021-03-17 13:47:13 +01:00
ThomasV
3c9838d999 lnworker: merge request_force_close and request_remote_force_close 2021-03-17 09:15:40 +01:00
bitromortac
8828998093 mpp_split: use single nodes for mpp payments over trampoline 2021-03-17 08:22:19 +01:00
SomberNight
5e12f88be3 lnworker: minor clean-up, fix typo 2021-03-16 19:19:26 +01:00
SomberNight
468f3b2b8d lnchannel: verify sig of remote chanupd (for inc edge of direct chan)
This is re the channel update for the incoming direction of our own channels.
This message can only come from the counterparty itself so maybe the sig check
is redundant... but for sanity I think we should check it anyway.
2021-03-16 19:07:31 +01:00
ThomasV
bcfcc20363 fix: add request_force_close method 2021-03-16 17:27:37 +01:00
SomberNight
dca182992f ln gossip: run sig checks in a thread
to avoid blocking the asyncio event loop
2021-03-15 20:44:24 +01:00
SomberNight
cedc71a8e3 ln gossip: make sure all signatures are verified
we have not been verifying signatures of ChannelUpdate messages...
(regression from 2d0ef78a11)
2021-03-15 20:44:20 +01:00
SomberNight
ea56a259e4 lnworker: (trivial) split handle_error_code_from_failed_htlc method 2021-03-15 20:44:16 +01:00
ThomasV
018f09f2af use mktx_for_open_channel in commands module. fix indentation 2021-03-12 19:05:25 +01:00
ThomasV
1a4e55a911 follow-up 90b228de83 2021-03-12 16:38:48 +01:00
ThomasV
8984db3384 follow-up 90b228de83 2021-03-12 16:28:56 +01:00
ThomasV
bed4ddbcb4 fix dict value assignment bug in import_channel_backup. In request_force_close, use Taskgroup with wait=any 2021-03-12 16:09:24 +01:00
ThomasV
90b228de83 fix wallet get_full_history: add onchain tx for channels not opened by us 2021-03-12 12:15:39 +01:00
SomberNight
2487a3fa90 tests: add test for prev 2021-03-11 20:35:21 +01:00
SomberNight
cb78f73ed0 lnworker: try to fail pending HTLCs when shutting down
This is most useful when receiving MPP where there is a non-trivial chance
that we have received some HTLCs for a payment but not all, and the user
closes the program. We try to fail them and wait for the fails to get
ACKed, with a timeout of course.
2021-03-11 19:31:22 +01:00
ThomasV
533d796a41 add TODO, rename check_received_mpp_htlc 2021-03-11 16:53:55 +01:00
ThomasV
549b9a95df test_lnpeer: add test for mpp_timeout 2021-03-10 17:09:07 +01:00
ThomasV
7ae82c8230 Revert "lnworker: simplify request_force_close_from_backup"
This reverts commit ce88b36e81.
2021-03-10 12:54:00 +01:00
SomberNight
3c019c2f9c daemon/wallet/network: make stop() methods async 2021-03-09 17:52:36 +01:00
ThomasV
ce88b36e81 lnworker: simplify request_force_close_from_backup 2021-03-09 12:28:25 +01:00
ThomasV
652d10aa5f Remove LNBackups object: no longer needed since LNWorker is instantiated by default. 2021-03-09 11:52:04 +01:00
ThomasV
ef661050c8 lnworker: set request status after LN payment 2021-03-09 09:35:43 +01:00
SomberNight
a125cd5392 tests: test payreq status after getting paid via LN
The test failures corresponding to single-part (non-MPP) payments expose a bug.

see 196b4c00a3/electrum/lnpeer.py (L1538-L1539)
`lnworker.add_received_htlc` is not called for single-part payments...
2021-03-08 22:18:06 +01:00
SomberNight
4069b455d0 lnaddr: add get_features method 2021-03-08 21:36:27 +01:00
ThomasV
196b4c00a3 Use new value of option_trampoline_routing flag, add it to our invoices.
Keep supporting old value for Eclair/Phoenix.
Do not add trampoline_routing_hints in invoices.
2021-03-08 19:16:48 +01:00
ThomasV
fd48b96335 follow-up prev commit 2021-03-08 17:45:00 +01:00
ThomasV
308b02ca7d lnworker: fix amount in htlc_log after mpp bucket failure 2021-03-08 17:23:52 +01:00
ThomasV
5df4466812 rm fixme; it was for intermediate stage, between commits. 2021-03-08 13:30:59 +01:00
SomberNight
edb214aeca lnworker.pay_to_node: re overpayment, raise before actually it happens 2021-03-06 14:23:00 +01:00
ThomasV
5663e59863 lnworker: fix amount_inflight.
(amount with routing fees were used on htlc failures)
2021-03-06 10:46:40 +01:00
ThomasV
31919d0425 lnworker: add assert amount_inflight <= amount_to_pay 2021-03-06 00:29:37 +01:00
ThomasV
5207c40cc3 fix trampoline forwarding: add_received_htlc must be indexed by payment_secret 2021-03-05 17:04:26 +01:00
ThomasV
2e4f45ec74 use two trampolines: fix blacklisting, use local variables for trampoline_fee_level and use_two_trampolines 2021-03-05 10:07:02 +01:00
ThomasV
5a2a724cb9 Receive MPP: Use persisted payment status to decide whether to
fulfill HTLCs. Without this commit, we might timeout a part of
a payment if the client is shut down before all parts are
fulfilled.
2021-03-04 14:11:55 +01:00