get_payments: do not include failed payments

This commit is contained in:
ThomasV 2019-05-06 12:35:04 +02:00
parent 2ec82433b4
commit 670424f080

View file

@ -177,9 +177,11 @@ class Channel(Logger):
for subject in LOCAL, REMOTE:
log = self.hm.log[subject]
for htlc_id, htlc in log.get('adds', {}).items():
rhash = bh2u(htlc.payment_hash)
if htlc_id in log.get('fails',{}):
continue
status = 'settled' if htlc_id in log.get('settles',{}) else 'inflight'
direction = SENT if subject is LOCAL else RECEIVED
rhash = bh2u(htlc.payment_hash)
out[rhash] = (self.channel_id, htlc, direction, status)
return out