Commit graph

4 commits

Author SHA1 Message Date
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