Skip to content

Commit

Permalink
Merge pull request spesmilo#7258 from bitromortac/2104-openchannel-7219
Browse files Browse the repository at this point in the history
kivy: improve openchannel dialog for trampoline
  • Loading branch information
SomberNight authored Apr 30, 2021
2 parents 7789497 + 97b3188 commit 1e34b96
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions electrum/gui/kivy/uix/dialogs/lightning_open_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from electrum.bitcoin import COIN
import electrum.simple_config as config
from electrum.logging import Logger
from electrum.lnutil import ln_dummy_address, extract_nodeid
from electrum.lnutil import ln_dummy_address, extract_nodeid, ConnStringFormatError

from .label_dialog import LabelDialog
from .confirm_tx_dialog import ConfirmTxDialog
Expand Down Expand Up @@ -76,11 +76,13 @@
size_hint: 0.5, None
height: '48dp'
on_release: s.do_paste()
disabled: not app.use_gossip
IconButton:
icon: f'atlas://{KIVY_GUI_PATH}/theming/light/camera'
size_hint: 0.5, None
height: '48dp'
on_release: app.scan_qr(on_complete=s.on_qr)
disabled: not app.use_gossip
Button:
text: _('Suggest')
size_hint: 1, None
Expand Down Expand Up @@ -180,7 +182,11 @@ def open_channel(self):
amount = '!' if self.is_max else self.app.get_amount(self.amount)
self.dismiss()
lnworker = self.app.wallet.lnworker
node_id, rest = extract_nodeid(conn_str)
try:
node_id, rest = extract_nodeid(conn_str)
except ConnStringFormatError as e:
self.app.show_error(_('Problem opening channel: ') + '\n' + str(e))
return
if lnworker.has_conflicting_backup_with(node_id):
msg = messages.MGS_CONFLICTING_BACKUP_INSTANCE
d = Question(msg, lambda x: self._open_channel(x, conn_str, amount))
Expand Down

0 comments on commit 1e34b96

Please sign in to comment.