Commit graph

11010 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
cf3e050b7e fix error message 2019-08-20 09:03:11 +02:00
ThomasV
8274067619 fix lnsweep: prevout 2019-08-20 09:03:11 +02:00
ThomasV
7e34554d1e fix test_lnchan 2019-08-20 09:03:11 +02:00
ThomasV
fde9f91902 lnchannel: store pre-signed sweep transactions after each new commitment 2019-08-20 09:03:11 +02:00
ThomasV
3019aa35cf on_close_channel: fix output index, and simplify lnsweep 2019-08-20 09:03:11 +02:00
ThomasV
729ddb8ec3 LNWatcher refactoring:
- do not store non-breach transactions
 - send 'channel_open' and 'channel_closed' events
 - force-closed channels are handled by LNWorker
2019-08-20 09:03:11 +02:00
ThomasV
1b7a3c25d1 lnsweep: return ctx.txid instead of None 2019-08-20 09:03:11 +02:00
Janus
56853da391 qt main_window: do not unregister on shutdown
this is handled differently in lightning, see commit

commit 6e355601261a60d143561f15760cc48f9c81d000
Author: ThomasV <thomasv@electrum.org>
Date:   Sun Jun 3 10:07:56 2018 +0200

    integrate channels_list with existing framework
2019-08-20 09:03:11 +02:00
Janus
545182e0a5 lnsweep: make maybe_create_sweeptx_for_their_ctx_to_local consistent 2019-08-20 09:03:11 +02:00
ThomasV
3aa36c1502 Channel: add current_commitment method 2019-08-20 09:03:11 +02:00
ThomasV
3222e26e01 format message 2019-08-20 09:03:11 +02:00
ThomasV
f4b9d2f47c show lightning network capacity in GUI 2019-08-20 09:03:11 +02:00
Janus
47c07f77b4 lnsweep: fix create_sweeptxs_for_their_just_revoked_ctx
in the case where an htlc is failed, it could happen
that we use the wrong list of htlcs to generate sweep
tx'es. we would use the pending list instead of the
committed list.

observed by sending 12300sat and then 123000sat,
the second payment fails and an AssertionError was
triggered cause the htlc output could not be found
in the ctx.

added some documentation to clarify the behaviour
of lnchan.included_htlcs.
2019-08-20 09:03:11 +02:00
Janus
1fbce71c1f update lightning.json 2019-08-20 09:03:11 +02:00
Janus
4a2a45d7e3 lightning: post rebase qt gui fixes 2019-08-20 09:03:11 +02:00
ThomasV
d493dd1953 add pycryptodomex to requirements 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
Janus
864d910888 qt: channel_details: add more info: sent/received, channel id, funding tx, short channel id, node id 2019-08-20 09:03:11 +02:00
Janus
762d8be84f lnaddr: make it possible to use lnaddr to decode arbitrary invoices on the cmd line 2019-08-20 09:03:11 +02:00
SomberNight
9256472485 rm 'cryptography' as dependency; use new pycryptodomex version
pycryptodomex 3.7 implemented chacha20_poly1305 and chacha20,
and it is already used (although optionally) to speed up AES,
so we can remove cryptography and make pycryptodomex mandatory for LN
2019-08-20 09:03:11 +02:00
ThomasV
c0a1af2032 fix channel closure:
- add 'CLOSING' state
 - wait until channel has no inflight HTLC
 - end fee negocitation when both parties agree on the fee
   (previously code ended it only when the other party had broadcast)
 - broadcast the closing transaction
2019-08-20 09:03:11 +02:00
ThomasV
5bc74772a2 follow up 'replace properties with functions' 2019-08-20 09:03:11 +02:00
ThomasV
0e3270a1d6 further simplify lnwatcher 2019-08-20 09:03:11 +02:00
SomberNight
dbc4549c0e lnchan: restore process_new_offchain_ctx 2019-08-20 09:03:11 +02:00
SomberNight
0070ae1fb1 fix prev 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
SomberNight
bc72966442 lnchan: follow-up "replace properties with functions" 2019-08-20 09:03:11 +02:00
ThomasV
88c6eeb966 make LNWatcher inherit AddressSynchronizer 2019-08-20 09:03:11 +02:00
ThomasV
78896897cb lnchan: replace properties with functions 2019-08-20 09:03:11 +02:00
Janus
c339eabd31 qt: channel_details: remove demo code 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
9d32031ca2 Kivy: Lightning support in Receive tab 2019-08-20 09:03:11 +02:00
Janus
ecac8f2880 tests/lnbase: stub on_channels_updated 2019-08-20 09:03:11 +02:00
Janus
7db9a22d63 Kivy: open channel dialog 2019-08-20 09:03:11 +02:00
ThomasV
3430d1aaa3 follow-up prev commit 2019-08-20 09:03:11 +02:00
ThomasV
5422de90a2 lightning: do not handle more than one fee update at a time 2019-08-20 09:03:11 +02:00
Janus
1352b0ce9f Kivy: Support Lightning in Send tab 2019-08-20 09:03:11 +02:00
Janus
f803bb571d kivy: restore channel list to working state, add [force-]closing functionality 2019-08-20 09:03:11 +02:00
Janus
1520338f37 fix ln tests 2019-08-20 09:03:11 +02:00
SomberNight
521fadb8cb lnutil: restructure channel config namedtuples (local/remote config) 2019-08-20 09:03:11 +02:00
Janus
1425628604 add command for listing invoices and their progress, fix list_channels 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
SomberNight
5b7c801ca4 after rebase fixes 2019-08-20 09:03:11 +02:00
Janus
8a98810df1 do not co-op close channels with pending 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
c570bc5fb1 avoid leaving FORCE_CLOSING state, rebroadcast closing tx if reorged out 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
6211e656a8 lnwatcher: do not get_transaction before broadcast
this workaround was inserted to avoid losing the interface
when rebroadcasting a transaction already in the mempool
many times. but since the network should make sure we always
have a interface ready, and this problem shouldn't happen on
mainnet, remove the workaround
2019-08-20 09:03:11 +02:00
Janus
c8dcf0b471 lnwatcher: more detailed logging, support notifying test suite of txs 2019-08-20 09:03:11 +02:00