Commit graph

147 commits

Author SHA1 Message Date
ThomasV
9a3a63d18e logging (follow-up rebase) 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
34f22e6681 lnrouter: load data before finding path 2019-08-20 09:03:11 +02:00
ThomasV
f0ac81419c increase timeout in open_channel 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
3abe30e9d8 basic watchtower synchronization 2019-08-20 09:03:11 +02:00
ThomasV
ec97d623a5 force-close channel if unfulfilled htlc is close to cltv expiry 2019-08-20 09:03:11 +02:00
ThomasV
8d77a7ecd8 save timestamps in htlc log 2019-08-20 09:03:11 +02:00
ThomasV
51466930f2 reestablish_peers_and_channels: spawn tasks in for loop 2019-08-20 09:03:11 +02:00
ThomasV
38f1436d78 post rebase fixes 2019-08-20 09:03:11 +02:00
ThomasV
436c313790 follow-up previous commit 2019-08-20 09:03:11 +02:00
ThomasV
9f188c087c Flatten the structure of lnrouter, so that DBSession is not used outside of ChannelDB 2019-08-20 09:03:11 +02:00
Janus
dd7c4b3bab sqlite in lnrouter 2019-08-20 09:03:11 +02:00
ThomasV
7a51f034e4 add future transactions to address synchronizer 2019-08-20 09:03:11 +02:00
ThomasV
7a0e8bb343 fix amount_msat sign in get_history 2019-08-20 09:03:11 +02:00
ThomasV
8b12f481da lightning: display forwarded payments as a single history item 2019-08-20 09:03:11 +02:00
ThomasV
3e443535a2 lnchannel: pass reference to lnworker 2019-08-20 09:03:11 +02:00
SomberNight
ef7a59b4a9 lnchannel: save htlc preimages as soon as possible but horribly hacky
will properly clean this up...
2019-08-20 09:03:11 +02:00
SomberNight
7292da24e6 lnchannel: only consider payments finished when we revoke our old ctx
in the old code,
`self.hm.received_in_ctn(self.config[REMOTE].ctn + 1)`
did not really make sense as "received_in_ctn" compares the argument against the LOCAL ctn
2019-08-20 09:03:11 +02:00
SomberNight
962628ac3d lnworker: minor clean-up re payment_completed 2019-08-20 09:03:11 +02:00
ThomasV
62be0c481c lightning: Save invoices and preimages separately. Save preimages when forwarding 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
ThomasV
a975ac1571 lnworker: get_channel_by_short_id 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
d9813540ac fix: test short_channel_id before removing from channel_db 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
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
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
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
2af178a586 Store boolean is_received in lightning invoices. Sort lightning history with timestamp. Minor fixes 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
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