URI: 
       tfix #5761 - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit aa37979100b9119414026862444bfdb13295e6d3
   DIR parent b9cf095e1a0e44121fd4f3b1861c14ff82d36931
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Mon, 18 Nov 2019 10:22:20 +0100
       
       fix #5761
       
       Diffstat:
         M electrum/gui/qt/main_window.py      |       5 ++---
         M electrum/lnworker.py                |       5 ++---
       
       2 files changed, 4 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
       t@@ -1390,8 +1390,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
        
                return False  # no errors
        
       -    def pay_lightning_invoice(self, invoice):
       -        amount_sat = self.amount_e.get_amount()
       +    def pay_lightning_invoice(self, invoice, amount_sat=None):
                attempts = LN_NUM_PAYMENT_ATTEMPTS
                def task():
                    self.wallet.lnworker.pay(invoice, amount_sat, attempts)
       t@@ -1469,7 +1468,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
        
            def do_pay_invoice(self, invoice):
                if invoice['type'] == PR_TYPE_LN:
       -            self.pay_lightning_invoice(invoice['invoice'])
       +            self.pay_lightning_invoice(invoice['invoice'], amount_sat=invoice['amount'])
                elif invoice['type'] == PR_TYPE_ONCHAIN:
                    outputs = invoice['outputs']
                    self.pay_onchain_dialog(self.get_coins(), outputs, invoice=invoice)
   DIR diff --git a/electrum/lnworker.py b/electrum/lnworker.py
       t@@ -845,10 +845,10 @@ class LNWallet(LNWorker):
        
            @log_exceptions
            async def _pay(self, invoice, amount_sat=None, attempts=1):
       -        lnaddr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP)
       +        lnaddr = self._check_invoice(invoice, amount_sat)
                payment_hash = lnaddr.paymenthash
                key = payment_hash.hex()
       -        amount = int(lnaddr.amount * COIN) if lnaddr.amount else None
       +        amount = int(lnaddr.amount * COIN)
                status = self.get_payment_status(payment_hash)
                if status == PR_PAID:
                    raise PaymentFailure(_("This invoice has been paid already"))
       t@@ -856,7 +856,6 @@ class LNWallet(LNWorker):
                    raise PaymentFailure(_("A payment was already initiated for this invoice"))
                info = PaymentInfo(lnaddr.paymenthash, amount, SENT, PR_UNPAID)
                self.save_payment_info(info)
       -        self._check_invoice(invoice, amount_sat)
                self.wallet.set_label(key, lnaddr.get_description())
                log = self.logs[key]
                for i in range(attempts):