open_channel: improved success message

This commit is contained in:
ThomasV 2018-10-11 18:28:38 +02:00
parent 6efe5db0d0
commit 46cf18ce5f
2 changed files with 7 additions and 3 deletions

View file

@ -1854,9 +1854,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
def open_channel(self, *args, **kwargs): def open_channel(self, *args, **kwargs):
def task(): def task():
return self.wallet.lnworker.open_channel(*args, **kwargs) return self.wallet.lnworker.open_channel(*args, **kwargs)
def on_success(result): def on_success(chan):
print(result) self.show_message('\n'.join([
self.show_message(_('Channel open')) _('Channel established.'),
_('Remote peer ID') + ':' + bh2u(chan.node_id),
_('This channel will be usable after 3 confirmations')
]))
WaitingDialog(self, _('Opening channel...'), task, on_success, self.on_error) WaitingDialog(self, _('Opening channel...'), task, on_success, self.on_error)
def query_choice(self, msg, choices): def query_choice(self, msg, choices):

View file

@ -200,6 +200,7 @@ class LNWorker(PrintError):
self.save_channel(chan) self.save_channel(chan)
self.network.lnwatcher.watch_channel(chan.get_funding_address(), chan.funding_outpoint.to_str()) self.network.lnwatcher.watch_channel(chan.get_funding_address(), chan.funding_outpoint.to_str())
self.on_channels_updated() self.on_channels_updated()
return chan
def on_channels_updated(self): def on_channels_updated(self):
self.network.trigger_callback('channels') self.network.trigger_callback('channels')