tlnhtlc: save settled or failed htlcs - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit e5f42a39735f5f73c96b9c83a6b0d7cab5efed5f
DIR parent efc8d50570670ccb5aaf0bc022b579ea4a2b93d6
HTML Author: Janus <ysangkok@gmail.com>
Date: Thu, 27 Sep 2018 18:59:06 +0200
lnhtlc: save settled or failed htlcs
Diffstat:
M electrum/lnhtlc.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
DIR diff --git a/electrum/lnhtlc.py b/electrum/lnhtlc.py
t@@ -680,11 +680,12 @@ class HTLCStateMachine(PrintError):
if type(i) is not UpdateAddHtlc:
htlcs.append(i)
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)
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)
return htlcs, removed