|
|
|
@ -305,8 +305,8 @@ class LNWallet(LNWorker): |
|
|
|
chan_id, htlc, _direction, status = plist[0] |
|
|
|
chan_id, htlc, _direction, status = plist[0] |
|
|
|
direction = 'sent' if _direction == SENT else 'received' |
|
|
|
direction = 'sent' if _direction == SENT else 'received' |
|
|
|
amount_msat= int(_direction) * htlc.amount_msat |
|
|
|
amount_msat= int(_direction) * htlc.amount_msat |
|
|
|
label = '' |
|
|
|
|
|
|
|
timestamp = htlc.timestamp |
|
|
|
timestamp = htlc.timestamp |
|
|
|
|
|
|
|
label = self.get_invoice_label(bfh(payment_hash)) |
|
|
|
else: |
|
|
|
else: |
|
|
|
# assume forwarding |
|
|
|
# assume forwarding |
|
|
|
direction = 'forwarding' |
|
|
|
direction = 'forwarding' |
|
|
|
@ -742,6 +742,14 @@ class LNWallet(LNWorker): |
|
|
|
except KeyError as e: |
|
|
|
except KeyError as e: |
|
|
|
raise UnknownPaymentHash(payment_hash) from e |
|
|
|
raise UnknownPaymentHash(payment_hash) from e |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_invoice_label(self, payment_hash: bytes) -> str: |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
lnaddr = self.get_invoice(payment_hash) |
|
|
|
|
|
|
|
label = lnaddr.get_description() |
|
|
|
|
|
|
|
except: |
|
|
|
|
|
|
|
label = '' |
|
|
|
|
|
|
|
return label |
|
|
|
|
|
|
|
|
|
|
|
def _calc_routing_hints_for_invoice(self, amount_sat): |
|
|
|
def _calc_routing_hints_for_invoice(self, amount_sat): |
|
|
|
"""calculate routing hints (BOLT-11 'r' field)""" |
|
|
|
"""calculate routing hints (BOLT-11 'r' field)""" |
|
|
|
self.channel_db.load_data() |
|
|
|
self.channel_db.load_data() |
|
|
|
|