Commit graph

143 commits

Author SHA1 Message Date
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
Janus
1d4c113a35 lnhtlc: remove lookup_htlc, use heterogeneously typed lists 2019-08-20 09:03:10 +02:00
Janus
699368b0b7 lnhtlc: save settled htlc amounts separately 2019-08-20 09:03:10 +02:00
SomberNight
d44afd9633 fix tests 2019-08-20 09:03:10 +02:00
Janus
efc8d50570 move connection string decoding to lnworker, fix test_lnutil 2019-08-20 09:03:10 +02:00
Janus
50b3bc939c avoid reading from queues concurrently in pay() 2019-08-20 09:03:10 +02:00
SomberNight
d29191b010 rename LNChanAnnVerifier 2019-08-20 09:03:10 +02:00
Janus
d5d9270d0c lnhtlc: save logs and feeupdates 2019-08-20 09:03:10 +02:00
Janus
eca5545004 lnhtlc: don't throw away fee updates or htlcs
also add inject_fees debug command
2019-08-20 09:03:10 +02:00
Janus
02eca03486 lnhtlc: cleanup and save settled htlcs 2019-08-20 09:03:10 +02:00
Janus
6f5209ef85 lnhtlc: test that sent amount is received 2019-08-20 09:03:10 +02:00
Janus
261fefb6f3 lnwatcher rebased 2019-08-20 09:03:10 +02:00
SomberNight
0b0bc89083 fix tests 2019-08-20 09:03:10 +02:00
SomberNight
c02cc9bb3b persist recent peers. implement dns seed bootstrapping.
dns seeds are currently disabled though, as they always seem to return mainnet nodes.
2019-08-20 09:03:10 +02:00
SomberNight
bc06ded4b9 persist nodes in channel_db on disk 2019-08-20 09:03:10 +02:00
SomberNight
5a05a92b3d move bolt-04 onion stuff to its own module 2019-08-20 09:03:10 +02:00
Janus
9247da5203 ln: share more code with control path for failed htlc, verify ctx'es 2019-08-20 09:03:10 +02:00