1
0

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.
This commit is contained in:
Janus
2018-12-04 20:53:41 +01:00
committed by ThomasV
parent 1fbce71c1f
commit 47c07f77b4
2 changed files with 16 additions and 4 deletions

View File

@@ -635,6 +635,18 @@ class Channel(PrintError):
def htlcs(self, subject, only_pending):
"""
only_pending: require the htlc's settlement to be pending (needs additional signatures/acks)
sets returned with True and False are disjunct
only_pending true:
skipped if settled or failed
<=>
included if not settled and not failed
only_pending false:
skipped if not (settled or failed)
<=>
included if not not (settled or failed)
included if settled or failed
"""
update_log = self.log[subject]
res = []