Commit graph

450 commits

Author SHA1 Message Date
SomberNight
30bf32b34b
use option varonion: actually use TLV payloads, and signal support 2020-04-01 21:47:42 +02:00
SomberNight
6ba08cc8d4
ln feature bits: flatten namespaces, and impl feature deps and ctxs
This implements:
- flat feature bits https://github.com/lightningnetwork/lightning-rfc/pull/666
- feature bit dependencies https://github.com/lightningnetwork/lightning-rfc/pull/719
2020-04-01 21:41:24 +02:00
SomberNight
90f3b667aa
small clean-up re max CLTV delta for LN 2020-03-30 02:46:14 +02:00
SomberNight
3ed6afce64
lnchannel: implement freezing channels (for receiving)
A bit weird, I know... :)
It allows for rebalancing our own channels! :P
2020-03-26 09:05:15 +01:00
SomberNight
79d202485e
lnworker: rename can_send to num_sats_can_send 2020-03-26 09:05:12 +01:00
SomberNight
7488cc91cd
qt channels: expose long channel id (in ctx menu and details dlg)
Also add separators to context menu to more visible separate
close/delete actions from rest.
2020-03-26 01:20:41 +01:00
SomberNight
2cc76fbbbd
lnworker: fix type error re pending_payments, and impl malformed htlcs
In old code, in lnpeer.htlc_switch(), "error" in lnworker.pending_payments
had incorrect type.

TODO: we need tests for payment failures...
2020-03-17 20:32:38 +01:00
SomberNight
b524460fdf
lnpeer: implement basic handling of "update_fail_malformed_htlc" 2020-03-17 20:31:50 +01:00
ThomasV
5bac2fea98 Qt: improve channel details window 2020-03-12 12:40:50 +01:00
ThomasV
fe2b40b83d Fix #6021: Do not transition channel state to CLOSED if tx is unconfirmed. 2020-03-11 11:49:53 +01:00
ThomasV
af457ea2ec follow-up 46d8080c76: own channels are no longer in channel_db 2020-03-11 10:26:07 +01:00
ThomasV
b6cb983733 lnworker.pay: run path finding in sep. thread (don't block evt loop) 2020-03-10 17:56:11 +01:00
ThomasV
e3019a7046 (minor) fix typo 2020-03-10 14:29:52 +01:00
ThomasV
2f31e9fa44 follow-up prev commit 2020-03-10 13:51:08 +01:00
ThomasV
3d69f3b0be improve payment status callbacks:
- add 'computing route' status for lightning payments
 - use separate callbacks for invoice status and payment popups
 - show payment error and payment logs in kivy
2020-03-10 13:27:02 +01:00
SomberNight
c95c0dcb80
lnrouter: add comments about path-finding blocking the asyncio loop 2020-03-09 20:39:13 +01:00
ThomasV
8b63f7176e Add short channel id to tx labels 2020-03-07 10:53:38 +01:00
SomberNight
ec7473789e
lnhtlc: speed-up methods for recent ctns
we maintain a set of interesting htlc_ids
2020-03-06 21:54:05 +01:00
ThomasV
2c617c3b00 move feerate warning to lnpeer 2020-03-06 18:14:00 +01:00
SomberNight
35a8812534
lnworker.reestablish_peer_for_given_channel: give each addr a chance
follow-up fa0ef9c548
2020-03-06 15:13:18 +01:00
ThomasV
b609088115 follow-up previous commit: broadcast_transaction does not return txid 2020-03-06 12:26:01 +01:00
ThomasV
888a6d726e Propagate exceptions raise by force_close to the GUI.
Define 'try_force_closing' for cases where we do not
want exceptions to be raised.
2020-03-06 12:18:33 +01:00
ThomasV
15fb8c0415 allow transition from FORCE_CLOSING to REDEEMED. define REDEEM_AFTER_DOUBLE_SPENT_DELAY 2020-03-06 11:40:08 +01:00
SomberNight
fa0ef9c548
ln: store network addresses for channel counterparties in channels
So we can reconnect to them without relying on gossip db.
2020-03-06 04:04:17 +01:00
ThomasV
cb14bde422 fix test_lnpeer 2020-03-05 11:10:14 +01:00
ThomasV
7f3542f080 lnworker: set invoice status if htlcs are received from previous session 2020-03-05 10:51:22 +01:00
ThomasV
8f3fcdd1a8 Fix detection of payments.
1. In lnhtlc, sent_in_ctn and failed_in_ctn need to look at the
remote ctx, and they need to be called when we receive a revocation,
not when we send one.

2. In lnchannel, we use 3 lnworker callbacks:
   - payment sent/payment failed (called when we receive a revocation)
   - payment received (called when we send a revocation)

3. Make revoke_current_commitment return a single value.
The second value was only used in tests, there is no need
to bloat the code with that
2020-03-05 07:03:09 +01:00
ThomasV
b9eaba3e85 replace await_local/remote 2020-03-05 07:03:09 +01:00
SomberNight
dae842e2ad
tests: made TestLNTransport.test_loop more robust 2020-03-04 17:57:40 +01:00
SomberNight
7962e17df6
invoices: deal with expiration of "0" mess
Internally, we've been using an expiration of 0 to mean "never expires".
For LN invoices, BOLT-11 does not specify what an expiration of 0 means.
Other clients seem to treat it as "0 seconds" (i.e. already expired).
This means there is no way to create a BOLT-11 invoice that "never" expires.

For LN invoices,
- we now treat an expiration of 0, , as "0 seconds",
- when creating an invoice, if the user selected never, we will put 100 years as expiration
2020-03-04 14:24:07 +01:00
SomberNight
01981f71fb
lnworker.add_peer: don't block event loop with DNS 2020-03-03 21:04:54 +01:00
SomberNight
fbd0c9aae8
lnworker: peer-bootstrapping: add IPv6 fallback nodes 2020-03-03 20:40:50 +01:00
SomberNight
59a428ea7f
lnworker: re-enable dns seeds for peer-finding bootstrap
but only for mainnet
2020-03-03 20:12:12 +01:00
ThomasV
367d30d6c0
Merge pull request #6003 from spesmilo/htlc_switch
Htlc switch
2020-03-02 22:14:09 +01:00
SomberNight
a97e7bae05
ChannelDB: make gossip sync progress updates cheaper
get_num_channels_partitioned_by_policy_count() was too slow
2020-03-02 16:56:15 +01:00
ThomasV
f801307a08 move htlc_switch task to lnpeer 2020-03-02 15:41:50 +01:00
ThomasV
5d3bca7bb8 htlc_switch: decouple maybe_send_commitment from htlc processing 2020-03-02 15:08:12 +01:00
ThomasV
cfc20845a2 lnworker: dissociate htlc forwarding and fulfillment 2020-03-02 11:54:08 +01:00
ThomasV
09675bd911 make maybe_fulfill_htlc, maybe_forward_htlc synchronous.
move async operations to lnworker.htlc_switch
2020-03-02 11:19:04 +01:00
ThomasV
d827aedd16 lnpeer: do not drop channel updates if cannot send 2020-03-02 11:19:04 +01:00
ThomasV
da67fda92a HTLC switch:
- fulfills/fails/forwards HTLCs
- onion_packets are saved when update_add_htlc is received
2020-03-02 11:19:04 +01:00
SomberNight
c7704fb8ee
lnworker: allow changing labels of chan-open/chan-close txns 2020-03-02 04:30:06 +01:00
SomberNight
67d24bf129
add LN gossip sync progress estimate indicator to Qt GUI 2020-02-29 20:03:35 +01:00
SomberNight
a32af44ff9
trivial clean-up (typing/imports) 2020-02-28 20:27:35 +01:00
ThomasV
077f778632 Replace lightning_settle_delay with enable_htlc_settle (asyncio.Event) 2020-02-28 10:15:28 +01:00
SomberNight
b21bcf5977
taskgroups: don't log CancelledError 2020-02-27 20:22:49 +01:00
SomberNight
ed234d3444
rename all TaskGroup() fields to "taskgroup"
for consistency
2020-02-27 19:13:56 +01:00
SomberNight
c8260249b0
lnworker: add own taskgroup (run in daemon.taskgroup) 2020-02-27 19:13:53 +01:00
ThomasV
34400c0710 Set channel state to OPENING as soon as we receive 'funding_signed',
instead of when the funding transaction has been broadcast, because
we have no reliable way to know when it will be broadcast.
2020-02-27 18:12:20 +01:00
SomberNight
9d1fa4cc99
(trivial) lnworker: move LNGossip.peer_closed to parent class 2020-02-26 20:31:51 +01:00