electrum

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

commit d9747a2ff14f8c6062d8f772a1e4c280b8616348
parent 56f4932f1085bf9b686b7cba92e495009eb9ed30
Author: ThomasV <thomasv@electrum.org>
Date:   Fri,  5 Jun 2020 15:04:33 +0200

wallet fixes for lightning disabled (follow up 6058829870fde0ef17b2e08a567110ecc381ab94)

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

diff --git a/electrum/wallet.py b/electrum/wallet.py @@ -1631,7 +1631,7 @@ class Abstract_Wallet(AddressSynchronizer, ABC): def get_invoice_status(self, invoice: Invoice): if invoice.is_lightning(): - status = self.lnworker.get_invoice_status(invoice) + status = self.lnworker.get_invoice_status(invoice) if self.lnworker else PR_UNKNOWN else: status = PR_PAID if self.is_onchain_invoice_paid(invoice) else PR_UNPAID return self.check_expired_status(invoice, status) @@ -1641,7 +1641,7 @@ class Abstract_Wallet(AddressSynchronizer, ABC): if r is None: return PR_UNKNOWN if r.is_lightning(): - status = self.lnworker.get_payment_status(bfh(r.rhash)) + status = self.lnworker.get_payment_status(bfh(r.rhash)) if self.lnworker else PR_UNKNOWN else: paid, conf = self.get_payment_status(r.get_address(), r.amount) status = PR_PAID if paid else PR_UNPAID @@ -1712,7 +1712,7 @@ class Abstract_Wallet(AddressSynchronizer, ABC): } if is_lightning: d['invoice'] = x.invoice - if status == PR_UNPAID: + if self.lnworker and status == PR_UNPAID: d['can_pay'] = self.lnworker.can_pay_invoice(x) else: d['outputs'] = [y.to_legacy_tuple() for y in x.outputs]