Commit graph

43 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
fde9f91902 lnchannel: store pre-signed sweep transactions after each new commitment 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
ThomasV
3aa36c1502 Channel: add current_commitment method 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
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
SomberNight
dbc4549c0e lnchan: restore process_new_offchain_ctx 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
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
1520338f37 fix ln tests 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
Janus
c570bc5fb1 avoid leaving FORCE_CLOSING state, rebroadcast closing tx if reorged out 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
Janus
001bb4ca09 remove incorrect docstrings, attribute docstring sources where applicable 2019-08-20 09:03:10 +02:00
SomberNight
c0ae7b5534 after rebase clean-up 2019-08-20 09:03:10 +02:00
SomberNight
ce2b572fa5 lnbase: more type annotations, and minor fix 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
a42c1067ab lnworker: fix listchannels 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
ThomasV
eb4e6b2e54 use WaitingDialog to close channels 2019-08-20 09:03:10 +02:00
Janus
15b0720f5e lightning channel reserves 2019-08-20 09:03:10 +02:00
Janus
0dfc9e512b fix co-op close 2019-08-20 09:03:10 +02:00
SomberNight
04ec7e9968 lnutil.make_funding_input: don't return payment pubkeys
order depends on who is initiator anyway
2019-08-20 09:03:10 +02:00
Janus
1f97a9753e redeem htlc outputs of our local commitment transaction back to wallet 2019-08-20 09:03:10 +02:00
SomberNight
f70e679aba some more type annotations that needed conditional imports 2019-08-20 09:03:10 +02:00
SomberNight
f3d1f71e94 lnchan: set diagnostic_name
previously was only set for tests
2019-08-20 09:03:10 +02:00
SomberNight
d511ecdc00 start failing htlcs 2019-08-20 09:03:10 +02:00
Janus
ac68c8f531 lnchan: add available_to_spend() 2019-08-20 09:03:10 +02:00
Janus
d317bdbd9b lnchan: make function for onion_keys decoding/encoding 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
SomberNight
cd175f0949 fix prev 2019-08-20 09:03:10 +02:00
ThomasV
9a59ffaf44 lnrouter: filter out unsuitable channels 2019-08-20 09:03:10 +02:00
ThomasV
87fb0da5e1 minor fix 2019-08-20 09:03:10 +02:00
ThomasV
e761f5b876 add watchtower class, send encumbered tx as json 2019-08-20 09:03:10 +02:00
Janus
94a10e6307 rebase fixup: use new broadcast_transaction API 2019-08-20 09:03:10 +02:00
Janus
1763d02b05 rename lnhtlc->lnchan, HTLCStateMachine->Channel 2019-08-20 09:03:10 +02:00
Renamed from electrum/lnhtlc.py (Browse further)