diff --git a/electrum/gui/qt/channel_details.py b/electrum/gui/qt/channel_details.py index a92dc907a..7b21fa369 100644 --- a/electrum/gui/qt/channel_details.py +++ b/electrum/gui/qt/channel_details.py @@ -54,8 +54,8 @@ class ChannelDetailsDialog(QtWidgets.QDialog): self.folders[keyname] = folder mapping = {} num = 0 - for pay_hash, item in htlcs.items(): - chan_id, i, direction, status = item + for item in htlcs: + pay_hash, chan_id, i, direction, status = item if status != keyname: continue it = self.make_htlc_item(i, direction) diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py index 0986353a6..350791294 100644 --- a/electrum/lnchannel.py +++ b/electrum/lnchannel.py @@ -246,6 +246,22 @@ class Channel(Logger): def get_next_feerate(self, subject): return self.hm.get_feerate_in_next_ctx(subject) + def get_payments(self): + out = [] + for subject in LOCAL, REMOTE: + log = self.hm.log[subject] + for htlc_id, htlc in log.get('adds', {}).items(): + if htlc_id in log.get('fails',{}): + status = 'failed' + elif htlc_id in log.get('settles',{}): + status = 'settled' + else: + status = 'inflight' + direction = SENT if subject is LOCAL else RECEIVED + rhash = bh2u(htlc.payment_hash) + out.append((rhash, self.channel_id, htlc, direction, status)) + return out + def get_settled_payments(self): out = {} for subject in LOCAL, REMOTE: