Browse Source

wallet: minor invoices fix

handle "lightning disabled & there are LN invoices in wallet" case
dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
SomberNight 5 years ago
parent
commit
a51a2a7f8f
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/wallet.py

5
electrum/wallet.py

@ -573,7 +573,7 @@ class Abstract_Wallet(AddressSynchronizer):
request_type = item.get('type')
if request_type == PR_TYPE_ONCHAIN:
item['status'] = PR_PAID if item.get('txid') is not None else PR_UNPAID
elif request_type == PR_TYPE_LN:
elif self.lnworker and request_type == PR_TYPE_LN:
item['status'] = self.lnworker.get_invoice_status(bfh(item['rhash']))
else:
return
@ -1365,7 +1365,7 @@ class Abstract_Wallet(AddressSynchronizer):
req['status'] = status
if conf is not None:
req['confirmations'] = conf
elif req['type'] == PR_TYPE_LN:
elif self.lnworker and req['type'] == PR_TYPE_LN:
req['status'] = self.lnworker.get_invoice_status(bfh(key))
else:
return
@ -1462,6 +1462,7 @@ class Abstract_Wallet(AddressSynchronizer):
def get_sorted_requests(self):
""" sorted by timestamp """
out = [self.get_request(x) for x in self.receive_requests.keys()]
out = [x for x in out if x is not None]
out.sort(key=operator.itemgetter('time'))
return out

Loading…
Cancel
Save