mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
wallet: minor invoices fix
handle "lightning disabled & there are LN invoices in wallet" case
This commit is contained in:
parent
0dc90491b2
commit
a51a2a7f8f
1 changed files with 3 additions and 2 deletions
|
@ -573,7 +573,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
||||||
request_type = item.get('type')
|
request_type = item.get('type')
|
||||||
if request_type == PR_TYPE_ONCHAIN:
|
if request_type == PR_TYPE_ONCHAIN:
|
||||||
item['status'] = PR_PAID if item.get('txid') is not None else PR_UNPAID
|
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']))
|
item['status'] = self.lnworker.get_invoice_status(bfh(item['rhash']))
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
@ -1365,7 +1365,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
||||||
req['status'] = status
|
req['status'] = status
|
||||||
if conf is not None:
|
if conf is not None:
|
||||||
req['confirmations'] = conf
|
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))
|
req['status'] = self.lnworker.get_invoice_status(bfh(key))
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
@ -1462,6 +1462,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
||||||
def get_sorted_requests(self):
|
def get_sorted_requests(self):
|
||||||
""" sorted by timestamp """
|
""" sorted by timestamp """
|
||||||
out = [self.get_request(x) for x in self.receive_requests.keys()]
|
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'))
|
out.sort(key=operator.itemgetter('time'))
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue