tkivy: fix open channel with "max" amt - electrum - Electrum Bitcoin wallet
 (HTM) git clone https://git.parazyd.org/electrum
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
       ---
 (DIR) commit 78513affe536ba7d8150dc2ee044e3258097317f
 (DIR) parent dc810f131d17e14dea7c347e07021a0850b1640a
 (HTM) Author: SomberNight <somber.night@protonmail.com>
       Date:   Mon,  7 Dec 2020 15:38:10 +0100
       
       kivy: fix open channel with "max" amt
       
       related #6169
       
       E | gui.kivy.uix.dialogs.lightning_open_channel.LightningOpenChannelDialog | Problem opening channel
       Traceback (most recent call last):
         File "/home/user/wspace/electrum/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py", line 167, in do_open_channel
           chan, funding_tx = lnworker.open_channel(
         File "/home/user/wspace/electrum/electrum/lnworker.py", line 859, in open_channel
           if funding_sat > LN_MAX_FUNDING_SAT:
       TypeError: '>' not supported between instances of 'str' and 'int'
       
       Diffstat:
         M electrum/gui/kivy/uix/dialogs/ligh… |      10 +++++++++-
       
       1 file changed, 9 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py b/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py
       t@@ -9,6 +9,7 @@ from electrum.util import bh2u
        from electrum.bitcoin import COIN
        import electrum.simple_config as config
        from electrum.logging import Logger
       +from electrum.lnutil import ln_dummy_address
        
        from .label_dialog import LabelDialog
        
       t@@ -164,10 +165,17 @@ class LightningOpenChannelDialog(Factory.Popup, Logger):
                lnworker = self.app.wallet.lnworker
                try:
                    funding_tx = lnworker.mktx_for_open_channel(coins=coins, funding_sat=amount)
       +        except Exception as e:
       +            self.logger.exception("Problem opening channel")
       +            self.app.show_error(_('Problem opening channel: ') + '\n' + repr(e))
       +            return
       +        # read funding_sat from tx; converts '!' to int value
       +        funding_sat = funding_tx.output_value_for_address(ln_dummy_address())
       +        try:
                    chan, funding_tx = lnworker.open_channel(
                        connect_str=conn_str,
                        funding_tx=funding_tx,
       -                funding_sat=amount,
       +                funding_sat=funding_sat,
                        push_amt_sat=0,
                        password=password)
                except Exception as e: