Commit graph

113 commits

Author SHA1 Message Date
ThomasV
b55f9e9e6a Do not route through channels for which we did not receive
both updates, because this often means one of the nodes is
offline.
2019-08-20 09:03:12 +02:00
ThomasV
2be68ac4d2 Use one LNWatcher instance per wallet 2019-08-20 09:03:12 +02:00
ThomasV
a8ce8109be Perform breach remedy without sweepstore:
- add functions to lnsweep
 - lnworker: analyze candidate ctx and htlc_tx
 - watchtower will be optional
 - add test for breach remedy with spent htlcs
 - save tx name as label
2019-08-20 09:03:12 +02:00
ThomasV
f2d58d0e3f optimize channel_db:
- use python objects mirrored by sql database
 - write sql to file asynchronously
 - the sql decorator is awaited in sweepstore, not in channel_db
2019-08-20 09:03:12 +02:00
ThomasV
06b5299b0f comment out convert, add logging statement 2019-08-20 09:03:12 +02:00
SomberNight
7e8be3d2e7 lnpeer: some exception handling clean up
main_loop should dump traces of unexpected exceptions to log.
Coroutines/functions invoked inside main_loop should simply propagate it
up the chain.
Typical exceptions are handled in handle_disconnect without dumping the trace.
2019-08-20 09:03:12 +02:00
ThomasV
70cd29f9e1 GUI refactoring for Kivy and lightning.
This also touches Qt and wallet code.
2019-08-20 09:03:12 +02:00
ThomasV
67f1ade798 send data_loss_protect fields if we support it 2019-08-20 09:03:12 +02:00
ThomasV
9eddb9844c on_commitment_signed: distinguish between exceptions 2019-08-20 09:03:11 +02:00
SomberNight
69bffac86a lnhtlc: fix adding htlc between sending commitment_signed and receiving revoke_and_ack 2019-08-20 09:03:11 +02:00
ThomasV
7be4cdaf18 redeem htlcs:
- fix bug in lnsweep: lnwatcher transactions were indexed by prev_txid
 - add test for breach remedy with unsettled htlcs
 - add timeout option to lnpay, and replace DO_NOT_SETTLE with SETTLE_DELAY
   so that we can read intermediate commitment tx in regtest
2019-08-20 09:03:11 +02:00
SomberNight
acbb458ef7 set default to_self_delay to 1 day 2019-08-20 09:03:11 +02:00
SomberNight
6d8c605307 move lnworker.first_block to constants 2019-08-20 09:03:11 +02:00
SomberNight
a0764c017c lnpeer: process gossip in chunks 2019-08-20 09:03:11 +02:00
ThomasV
6d9ef29690 redo LNWorker pay:
- wait until htlc has been fulfilled
 - raise if htlc is not fulfilled
 - return boolean success
 - try multiple paths in GUI
2019-08-20 09:03:11 +02:00
ThomasV
a5570d94f3 channel blacklist: minor fix 2019-08-20 09:03:11 +02:00
ThomasV
3c0df28c98 do not include 'force_closing' in channel states, because it is not part of the peer protocol 2019-08-20 09:03:11 +02:00
ThomasV
eb4e6bb0de improve filter_channel_updates
blacklist channels that do not really get updated
2019-08-20 09:03:11 +02:00
ThomasV
f4b3d7627d query_short_channel_ids: use Event instead of Lock 2019-08-20 09:03:11 +02:00
ThomasV
d30e894aaf fix: add_channel_update 2019-08-20 09:03:11 +02:00
ThomasV
b055eeace2 prune channels older than two weeks from database 2019-08-20 09:03:11 +02:00
ThomasV
522ce5bb9f verify channel updates in peer's TaskGroup 2019-08-20 09:03:11 +02:00
ThomasV
308dc6aa6b use a single queue for gossip messages, so that they are processed in the correct order 2019-08-20 09:03:11 +02:00
ThomasV
e68f318b12 verify node and channel announcements before entering sql lock 2019-08-20 09:03:11 +02:00
SomberNight
fbafc77f01 lnpeer query_short_channel_ids: BOLT-07 says ids must be sorted
this is why most remote peers were disconnecting upon receiving this msg
2019-08-20 09:03:11 +02:00
SomberNight
afc5717cf0 lnpeer reply_channel_range: handle lnd 2019-08-20 09:03:11 +02:00
ThomasV
0e42fd9f17 parallelize short_channel_id requests 2019-08-20 09:03:11 +02:00
ThomasV
1011245c5e LNGossip: sync channel db using query_channel_range 2019-08-20 09:03:11 +02:00
SomberNight
cc57da704b logging: adapt lightning branch to logging changes 2019-08-20 09:03:11 +02:00
ThomasV
730be17aba Use separate lightning nodes for gossip and channel operations. 2019-08-20 09:03:11 +02:00
ThomasV
dac686b11d minor fix 2019-08-20 09:03:11 +02:00
ThomasV
796f199a5b follow-up prev commit 2019-08-20 09:03:11 +02:00
ThomasV
a6469904ee fix verify_sig_for_channel_update: use raw message 2019-08-20 09:03:11 +02:00
ThomasV
407114d3cc lnpeer:
- disable option data_loss_protect
 - disable query_short_channel_ids
 - increase timeouts in pay
2019-08-20 09:03:11 +02:00
ThomasV
f0ac81419c increase timeout in open_channel 2019-08-20 09:03:11 +02:00
ThomasV
5eab60621d lnpeer:
- send data_loss_protect fields with channel_reestablish
 - close connection if we receive an unknown channel_reestablish
 - log all exceptions that make us close a connection
 - formatting
2019-08-20 09:03:11 +02:00
ThomasV
93e8d4f953 channel_db: fix timestamp_range, reduce verbosity 2019-08-20 09:03:11 +02:00
ThomasV
aa398993cf lnrouter fixes:
- use gossip_queries_req instead of initial_routing_sync
 - add connected nodes to recent peers only after successful init
 - derive timestamp used with gossip_timestamp_filter from channel_db
 - fix query_short_channel_ids:
     1. channel IDs must be sorted with zlib
     2. limit request to 100
     3. do not abuse this to request node_announcements; it is fine not to have all nodes.
 - fix get_recent_peers:
     1. do not set last_connected_date to 'now' if we never connected a node
     2. sql query was misconstructed and was returning only one peer
 - populate FALLBACK_NODE_LIST_MAINNET with nodes that have the requested flags
2019-08-20 09:03:11 +02:00
ThomasV
f5eb369fb7 lnpeer: spawn wait_for(self.initialized) to kill the TaskGroup if it times out 2019-08-20 09:03:11 +02:00
ThomasV
023d4026b9 fix local_index in channel _shutdown 2019-08-20 09:03:11 +02:00
ThomasV
3abe30e9d8 basic watchtower synchronization 2019-08-20 09:03:11 +02:00
ThomasV
c155293166 follow-up variable renaming 2019-08-20 09:03:11 +02:00
ThomasV
8d77a7ecd8 save timestamps in htlc log 2019-08-20 09:03:11 +02:00
ThomasV
ecd9508233 follow-up previous commit 2019-08-20 09:03:11 +02:00
ThomasV
a7d37b72db factorize channel opening code into chan.open_with_first_pcp 2019-08-20 09:03:11 +02:00
ThomasV
c3f6351922 simplify points, remove side-effect in reestablish_channel 2019-08-20 09:03:11 +02:00
ThomasV
b5fd27c64c fix local/remote confusion in reestablish_channel 2019-08-20 09:03:11 +02:00
Janus
95a2174789 sqlite in lnrouter: lnpeer: introduce _gossip_loop for gossip handling separated from message handling 2019-08-20 09:03:11 +02:00
Janus
945e1dc4ee sqlite in lnrouter: request missing channel_announcements and node_announcements 2019-08-20 09:03:11 +02:00
Janus
dd7c4b3bab sqlite in lnrouter 2019-08-20 09:03:11 +02:00