tget_payments: do not include failed payments - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 670424f080c8446689bfd6f5a5848db0b98db862
DIR parent 2ec82433b43b60a635a4d80af87381d5017c2fc1
HTML Author: ThomasV <thomasv@electrum.org>
Date: Mon, 6 May 2019 12:35:04 +0200
get_payments: do not include failed payments
Diffstat:
M electrum/lnchannel.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
DIR diff --git a/electrum/lnchannel.py b/electrum/lnchannel.py
t@@ -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