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
dff1822c37
fix watchtower: sweep_tx must not be None
2019-08-20 09:03:12 +02:00
ThomasV
d9b041e64d
encapsulate detect_who_closed in channel
2019-08-20 09:03:11 +02:00
ThomasV
740ef09883
simplify_lnsweep
2019-08-20 09:03:11 +02:00
ThomasV
3349e941de
lnsweep: minor fix
2019-08-20 09:03:11 +02:00
ThomasV
81d340b19c
lnworker: do not create sweep transactions before outputs can be redeemed
2019-08-20 09:03:11 +02:00
ThomasV
8d99fe8243
Let lnworker sweep HTLC outputs after breach, instead of lnwatcher
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
ThomasV
7418bd4552
lnsweep: simplify a few methods
2019-08-20 09:03:11 +02:00
ThomasV
6bbdbf7596
rework on_channel_closed in LNWorker:
...
- use detect_who_closed; this allows us to redeem to_remote of breach ctx
- do not redeem to_local of breach ctx, because it is redundant with lnwatcher
- rename a few methods
2019-08-20 09:03:11 +02:00
SomberNight
930d21c31c
channel close handling: detect situation based on output addresses
...
WIP...
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
3e443535a2
lnchannel: pass reference to lnworker
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
8fc1779b0d
ln: add test_lnwatcher
2019-08-20 09:03:11 +02:00
Janus
51bc02557d
ln: fix sweeping htlc output from remote ctx (timeout e.g. without htlc tx)
2019-08-20 09:03:11 +02:00
Janus
e56e849505
lnchan refactor
...
- replace undoing logic with new HTLCManager class
- separate SENT/RECEIVED
- move UpdateAddHtlc to lnutil
2019-08-20 09:03:11 +02:00
Janus
3ccd2fedff
ln: two remaining encumberedTx removal remnants
2019-08-20 09:03:11 +02:00
ThomasV
5776b322f7
formatting
2019-08-20 09:03:11 +02:00
ThomasV
b0f39718bb
remove useless returns and cryptic names
2019-08-20 09:03:11 +02:00
Janus
2c1fcb2f54
ln: remove EncumberedTransaction
2019-08-20 09:03:11 +02:00
Janus
3975560db5
lnsweep: use dicts consistently
2019-08-20 09:03:11 +02:00
ThomasV
8274067619
fix lnsweep: prevout
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
1b7a3c25d1
lnsweep: return ctx.txid instead of None
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
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
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