Commit graph

11441 commits

Author SHA1 Message Date
ThomasV
5d26f51ad0 lnchannel: fix error message 2019-08-20 09:03:11 +02:00
ThomasV
a40207cbbb Refactor LNPeer in order to support HTLC forwarding:
1. Do not perform channel updates in coroutines, because they would get executed in random order.
 2. After applying channel updates, wait only for the relevant commitment (local or remote) and not for both, because local and remote might be out of sync (BOLT 2).
 3. When waiting for a commitment, wait until a given ctn has been reached, because a queue cannot be shared by several coroutines
2019-08-20 09:03:11 +02:00
ThomasV
50b4f785a9 test_lnpeer: add names 2019-08-20 09:03:11 +02:00
ThomasV
3dce65dc73 Rename lnchan, lnchannel_verifier, lnbase
Auto-completions are a pain if files share a long prefix
2019-08-20 09:03:11 +02:00
Janus
8274a963e6 lnworker: save outgoing invoice when initiating payment 2019-08-20 09:03:11 +02:00
Janus
98e85fd16d qt: channel_details: prevent crash on stuck SENT htlc 2019-08-20 09:03:11 +02:00
Janus
5f1feee331 move lightning message encoding to new lnmsg module 2019-08-20 09:03:11 +02:00
Janus
f5cee9ecf6 lightning: post-rebase fixes, read_QIcon and invalid import 2019-08-20 09:03:11 +02:00
ThomasV
d5006e83e7 test_forwarding: do not set HOME 2019-08-20 09:03:11 +02:00
ThomasV
954e4c8892 lnbase: rename methods, fix tests 2019-08-20 09:03:11 +02:00
ThomasV
909f1e77de script that tests htlc forwarding 2019-08-20 09:03:11 +02:00
ThomasV
43e6e08840 Forward HTLCs 2019-08-20 09:03:11 +02:00
ThomasV
a975ac1571 lnworker: get_channel_by_short_id 2019-08-20 09:03:11 +02:00
ThomasV
fa96efabb5 lnpeer: receive_and_revoke, send_and_revoke 2019-08-20 09:03:11 +02:00
ThomasV
f4b2644620 set short_channel_id regardless of channel state, because peer might be disconnected 2019-08-20 09:03:11 +02:00
ThomasV
b265212fe6 show amount in channel opening/closure 2019-08-20 09:03:11 +02:00
ThomasV
d9813540ac fix: test short_channel_id before removing from channel_db 2019-08-20 09:03:11 +02:00
ThomasV
108a986ef0 history tab: render channel opening/closure on a single line 2019-08-20 09:03:11 +02:00
ThomasV
82e8bcebb6 restructure channel_reestablish, resend funding_locked if needed 2019-08-20 09:03:11 +02:00
ThomasV
8e753f998a fix tests 2019-08-20 09:03:11 +02:00
ThomasV
a3c6f82bb2 move LNPeer handshake back into initialize 2019-08-20 09:03:11 +02:00
ThomasV
42cbe74e95 history: better handling of None timestamps 2019-08-20 09:03:11 +02:00
ThomasV
2a112b867b follow-up previous commit 2019-08-20 09:03:11 +02:00
ThomasV
b5482e4470 create transport and perform handshake before creating Peer 2019-08-20 09:03:11 +02:00
ThomasV
61638664f7 do not add ephemeral addresses to recent peers 2019-08-20 09:03:11 +02:00
ThomasV
472e82e387 fix channel closure when it was requested by the remote party 2019-08-20 09:03:11 +02:00
ThomasV
d383573bc3 CLI: use funding_point in channel_open and channel_close. add host:port to nodeid 2019-08-20 09:03:11 +02:00
ThomasV
0924503cb6 rpartition->rsplit 2019-08-20 09:03:11 +02:00
ThomasV
776caeeff0 follow-up prev commit: use maxsize to sort timestamps 2019-08-20 09:03:11 +02:00
ThomasV
f04e10f61a save channel timestamps, and show lightning payments in history tab 2019-08-20 09:03:11 +02:00
ThomasV
ae402303ca channel: is_closed 2019-08-20 09:03:11 +02:00
ThomasV
f6f5cbee72 fix lnworker.get_balance 2019-08-20 09:03:11 +02:00
ThomasV
b7d93e2e11 gui: display lightning balance in status bar 2019-08-20 09:03:11 +02:00
Janus
18bd934461 ln: show full chan id in list, use Event for initialized, more timeouts, return peer from add_peer, set max_htlc_value_in_flight_msat to capacity 2019-08-20 09:03:11 +02:00
ThomasV
19e60f00bb add watchtower_window 2019-08-20 09:03:11 +02:00
ThomasV
7bb4ea150f gui: show incoming lightning requests, add on-chain icon 2019-08-20 09:03:11 +02:00
ThomasV
2af178a586 Store boolean is_received in lightning invoices. Sort lightning history with timestamp. Minor fixes 2019-08-20 09:03:11 +02:00
Janus
4e3b2b5479 tests: update lnbase test to use 4-tuple for invoices 2019-08-20 09:03:11 +02:00
ThomasV
281d51c002 follow-up prev commit 2019-08-20 09:03:11 +02:00
ThomasV
0e8dba897e lightning:
* store invoices for both directions
* do not store lightning_payments_inflight, lightning_payments_completed in lnworker
* payment history is returned by get_payments method of LNChannel
* command line: lightning history, lightning_invoices
* re-enable push_msat
2019-08-20 09:03:11 +02:00
Janus
d80b709aa4 lnbase: fix on_open_channel, add TODOs for missing validation 2019-08-20 09:03:11 +02:00
Janus
d5ed4309bb revert low max_htlc_value_in_flight_msat, fix test
spec does not mention that there can be an upper bound
on max_htlc_value_in_flight_msat, so don't try to make
any node happy that has a max limit on this.
2019-08-20 09:03:11 +02:00
Janus
e6bd3959e0 ln: handle channel limits better, show remote limits in details dialog, replace rusty's testnet peer (doesn't work currently) 2019-08-20 09:03:11 +02:00
ThomasV
0a08ccc1c6 rename paying -> inflight 2019-08-20 09:03:11 +02:00
ThomasV
b0d6000771 turn lightning_payments_completed into dict. Show status of lightning payments in GUI. Make 'listchannels' available offline 2019-08-20 09:03:11 +02:00
ThomasV
26ced1b343 fix test 2019-08-20 09:03:11 +02:00
ThomasV
d789f11898 remove deterministic derivation for testing 2019-08-20 09:03:11 +02:00
ThomasV
e6d680ec1b instanciate LNWorker without Network 2019-08-20 09:03:11 +02:00
Janus
7cf4f40dcb ln: warn when negotiated feerate is too low 2019-08-20 09:03:11 +02:00
Janus
8fc1779b0d ln: add test_lnwatcher 2019-08-20 09:03:11 +02:00