commit 98e85fd16d9eb15a98d6fe7262d54d92f744502a
parent 5f1feee33114775f1435ff8cf77bf9e2cb41172c
Author: Janus <ysangkok@gmail.com>
Date: Fri, 8 Feb 2019 18:23:21 +0100
qt: channel_details: prevent crash on stuck SENT htlc
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/electrum/gui/qt/channel_details.py b/electrum/gui/qt/channel_details.py
@@ -71,16 +71,20 @@ class ChannelDetailsDialog(QtWidgets.QDialog):
invoices = dict(self.window.wallet.lnworker.invoices)
for pay_hash, item in htlcs.items():
chan_id, i, direction, status = item
+ lnaddr = None
if pay_hash in invoices:
invoice = invoices[pay_hash][1]
lnaddr = lndecode(invoice)
if status == 'inflight':
- it = self.make_inflight(lnaddr, i, direction)
+ if lnaddr is not None:
+ it = self.make_inflight(lnaddr, i, direction)
+ else:
+ it = self.make_htlc_item(i, direction)
elif status == 'settled':
it = self.make_htlc_item(i, direction)
# if we made the invoice and still have it, we can show more info
- if pay_hash in invoices:
- self.append_lnaddr(it, lndecode(invoice))
+ if lnaddr is not None:
+ self.append_lnaddr(it, lnaddr)
self.folders[status].appendRow(it)
mapping[i.payment_hash] = num
num += 1