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'
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user