electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit a51a2a7f8f822a63b5f04a26229bc12cbd937343
parent 0dc90491b2730c8c77d3a6816b513b81e5212971
Author: SomberNight <somber.night@protonmail.com>
Date:   Mon,  7 Oct 2019 05:29:34 +0200

wallet: minor invoices fix

handle "lightning disabled & there are LN invoices in wallet" case

Diffstat:
Melectrum/wallet.py | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/electrum/wallet.py b/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