mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
lnhtlc: save settled or failed htlcs
This commit is contained in:
parent
efc8d50570
commit
e5f42a3973
1 changed files with 4 additions and 3 deletions
|
@ -680,11 +680,12 @@ class HTLCStateMachine(PrintError):
|
||||||
if type(i) is not UpdateAddHtlc:
|
if type(i) is not UpdateAddHtlc:
|
||||||
htlcs.append(i)
|
htlcs.append(i)
|
||||||
continue
|
continue
|
||||||
if i.locked_in[LOCAL] is not None or i.locked_in[REMOTE] is not None:
|
settled = SettleHtlc(i.htlc_id) in self.log[-subject]
|
||||||
|
failed = FailHtlc(i.htlc_id) in self.log[-subject]
|
||||||
|
locked_in = i.locked_in[LOCAL] is not None or i.locked_in[REMOTE] is not None
|
||||||
|
if locked_in or settled or failed:
|
||||||
htlcs.append(i)
|
htlcs.append(i)
|
||||||
else:
|
else:
|
||||||
# should not settle or fail before being locked in
|
|
||||||
assert SettleHtlc(i.htlc_id) not in self.log[-subject] and FailHtlc(i.htlc_id) not in self.log[-subject]
|
|
||||||
removed.append(i.htlc_id)
|
removed.append(i.htlc_id)
|
||||||
return htlcs, removed
|
return htlcs, removed
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue