Commit graph

360 commits

Author SHA1 Message Date
Janus
8274a963e6 lnworker: save outgoing invoice when initiating payment 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
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
8e753f998a fix tests 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
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
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
ThomasV
0a08ccc1c6 rename paying -> inflight 2019-08-20 09:03:11 +02:00
Janus
8fc1779b0d ln: add test_lnwatcher 2019-08-20 09:03:11 +02:00
Janus
e56e849505 lnchan refactor
- replace undoing logic with new HTLCManager class
- separate SENT/RECEIVED
- move UpdateAddHtlc to lnutil
2019-08-20 09:03:11 +02:00
Janus
2c1fcb2f54 ln: remove EncumberedTransaction 2019-08-20 09:03:11 +02:00
Janus
06d4224101 lnchan: remove debugging code, commented out code 2019-08-20 09:03:11 +02:00
Janus
2323118bda lnchan: only sign force_close_tx when demanded, assure consistency, fix test 2019-08-20 09:03:11 +02:00
Janus
1d8fe52fa3 lnchan: make force_close_tx() assure that tx is valid, trigger failure in test 2019-08-20 09:03:11 +02:00
ThomasV
7e34554d1e fix test_lnchan 2019-08-20 09:03:11 +02:00
Janus
133e5ec8c3 use gossip_timestamp_filter instead of request_initial_sync 2019-08-20 09:03:11 +02:00
SomberNight
595cfcbb65 move sweeping methods from lnchan.py to new file
also sweep "received" htlcs from "our" ctx
also sweep htlcs from their ctx (non-breach)
extract ctn; included_htlcs_in_their_latest_ctxs
2019-08-20 09:03:11 +02:00
ThomasV
78896897cb lnchan: replace properties with functions 2019-08-20 09:03:11 +02:00
Janus
e3409d32ef channel details with list of htlcs 2019-08-20 09:03:11 +02:00
Janus
ecac8f2880 tests/lnbase: stub on_channels_updated 2019-08-20 09:03:11 +02:00
ThomasV
3430d1aaa3 follow-up prev commit 2019-08-20 09:03:11 +02:00
Janus
1520338f37 fix ln tests 2019-08-20 09:03:11 +02:00
Janus
783cac1f23 function that returns map from commitment number to list of HTLCs 2019-08-20 09:03:11 +02:00
Janus
9cf7aa054d call force_close_channel on LNWorker, not Peer 2019-08-20 09:03:11 +02:00
Janus
0ea87278fb move force_close_channel to lnbase, test it, add FORCE_CLOSING state 2019-08-20 09:03:11 +02:00
Janus
39fa13b938 lnchan: use NamedTuple for logs instead of dict with static keys (adds, locked_in, settles, fails) 2019-08-20 09:03:10 +02:00
Janus
72187a4341 lnchan: make sign_next_commitment revert state 2019-08-20 09:03:10 +02:00
SomberNight
c0ae7b5534 after rebase clean-up 2019-08-20 09:03:10 +02:00
Janus
7e76e82152 test_lnbase: add test that pays to another local electrum 2019-08-20 09:03:10 +02:00
Janus
f5201327d1 add lnd copyright boilerplate to lnchan, test_lnchan 2019-08-20 09:03:10 +02:00
Janus
85789d8a09 lnbase: mark initialized later, add tests, etc
- consistent node_id sorting
- require OPTION_DATA_LOSS_PROTECT and test it
2019-08-20 09:03:10 +02:00
Janus
a5a7c1406e lightning channels reserves: use pretty balance in Qt, fix bugs, add tests 2019-08-20 09:03:10 +02:00
Janus
15b0720f5e lightning channel reserves 2019-08-20 09:03:10 +02:00
Janus
d6f62d4e7f follow-up redeeming of local outgoing htlc outputs, fix tests 2019-08-20 09:03:10 +02:00
SomberNight
2364de930b lnrouter: run Dijkstra in reverse direction 2019-08-20 09:03:10 +02:00
SomberNight
ded11b4d9e lnonion: implement error packet construction 2019-08-20 09:03:10 +02:00
Janus
ac68c8f531 lnchan: add available_to_spend() 2019-08-20 09:03:10 +02:00
SomberNight
e6a0b641d5 lnaddr: encode min_final_cltv into invoice 2019-08-20 09:03:10 +02:00
SomberNight
2e5552816c if payment fails with UPDATE onion error, also utilise channel_update for private channels 2019-08-20 09:03:10 +02:00
Janus
962f70c7da ln: add lightning_listen config option 2019-08-20 09:03:10 +02:00
Janus
eabe23f6b8 make function for determining who pays fee 2019-08-20 09:03:10 +02:00
ThomasV
409a336071 fix tests (follow-up previous commit) 2019-08-20 09:03:10 +02:00
SomberNight
0578bbd5d0 fix tests 2019-08-20 09:03:10 +02:00
SomberNight
7589bdc6a9 fix tests 2019-08-20 09:03:10 +02:00
Janus
1763d02b05 rename lnhtlc->lnchan, HTLCStateMachine->Channel 2019-08-20 09:03:10 +02:00
Janus
b26dc66567 lnhtlc: only store feerate once, don't store heights since we do not roll back 2019-08-20 09:03:10 +02:00
Janus
e8471e483b lnhtlc: merge config and state, remove unnecessary properties 2019-08-20 09:03:10 +02:00