fix get_payments
This commit is contained in:
@@ -54,8 +54,8 @@ class ChannelDetailsDialog(QtWidgets.QDialog):
|
|||||||
self.folders[keyname] = folder
|
self.folders[keyname] = folder
|
||||||
mapping = {}
|
mapping = {}
|
||||||
num = 0
|
num = 0
|
||||||
for pay_hash, item in htlcs.items():
|
for item in htlcs:
|
||||||
chan_id, i, direction, status = item
|
pay_hash, chan_id, i, direction, status = item
|
||||||
if status != keyname:
|
if status != keyname:
|
||||||
continue
|
continue
|
||||||
it = self.make_htlc_item(i, direction)
|
it = self.make_htlc_item(i, direction)
|
||||||
|
|||||||
@@ -246,6 +246,22 @@ class Channel(Logger):
|
|||||||
def get_next_feerate(self, subject):
|
def get_next_feerate(self, subject):
|
||||||
return self.hm.get_feerate_in_next_ctx(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):
|
def get_settled_payments(self):
|
||||||
out = {}
|
out = {}
|
||||||
for subject in LOCAL, REMOTE:
|
for subject in LOCAL, REMOTE:
|
||||||
|
|||||||
Reference in New Issue
Block a user