URI: 
       tminor: use wallet.has_lightning() - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit d870778a1b525f635a57ef20e92cdac5bf092499
   DIR parent 599797c966eca83bc246c8f50c4b9610ebf82be9
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Mon, 22 Jun 2020 16:48:14 +0200
       
       minor: use wallet.has_lightning()
       
       Diffstat:
         M electrum/gui/qt/main_window.py      |       9 ++++-----
       
       1 file changed, 4 insertions(+), 5 deletions(-)
       ---
   DIR diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
       t@@ -487,7 +487,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
            def load_wallet(self, wallet):
                wallet.thread = TaskThread(self, self.on_error)
                self.update_recently_visited(wallet.storage.path)
       -        if wallet.lnworker:
       +        if wallet.has_lightning():
                    util.trigger_callback('channels_updated', wallet)
                self.need_update.set()
                # Once GUI has been initialized check if we want to announce something since the callback has been called before the GUI was initialized
       t@@ -597,7 +597,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
                backup_dir = self.config.get('backup_dir')
                backup_dir_label = HelpLabel(_('Backup directory') + ':', backup_help)
                msg = _('Please select a backup directory')
       -        if self.wallet.lnworker and self.wallet.lnworker.channels:
       +        if self.wallet.has_lightning() and self.wallet.lnworker.channels:
                    msg += '\n\n' + ' '.join([
                        _("Note that lightning channels will be converted to channel backups."),
                        _("You cannot use channel backups to perform lightning payments."),
       t@@ -962,10 +962,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
                            text +=  " [%s unconfirmed]"%(self.format_amount(u, is_diff=True).strip())
                        if x:
                            text +=  " [%s unmatured]"%(self.format_amount(x, is_diff=True).strip())
       -                if self.wallet.lnworker:
       +                if self.wallet.has_lightning():
                            l = self.wallet.lnworker.get_balance()
                            text += u'    \U0001f5f2 %s'%(self.format_amount_and_units(l).strip())
       -
                        # append fiat balance and price
                        if self.fx.is_enabled():
                            text += self.fx.get_fiat_status_text(c + u + x,
       t@@ -1520,7 +1519,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
                    invoice_str = self.payto_e.lightning_invoice
                    if not invoice_str:
                        return
       -            if not self.wallet.lnworker:
       +            if not self.wallet.has_lightning():
                        self.show_error(_('Lightning is disabled'))
                        return
                    invoice = LNInvoice.from_bech32(invoice_str)