electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 6a0ada3f790025ea4661674d790aa25ec10df75a
parent bdca7be1c73d7cccd9bccd4436167e7f5fcc3869
Author: bitromortac <bitromortac@protonmail.com>
Date:   Wed, 14 Oct 2020 07:12:15 +0200

qt: display warning when first channel is opened

Diffstat:
Melectrum/gui/qt/channels_list.py | 16+++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py @@ -287,12 +287,26 @@ class ChannelsList(MyTreeView): h.addStretch() self.swap_button = EnterButton(_('Swap'), self.swap_dialog) self.swap_button.setEnabled(self.parent.wallet.has_lightning()) - self.new_channel_button = EnterButton(_('Open Channel'), self.new_channel_dialog) + self.new_channel_button = EnterButton(_('Open Channel'), self.new_channel_with_warning) self.new_channel_button.setEnabled(self.parent.wallet.has_lightning()) h.addWidget(self.new_channel_button) h.addWidget(self.swap_button) return h + def new_channel_with_warning(self): + if not self.parent.wallet.lnworker.channels: + warning1 = _("Lightning support in Electrum is experimental. " + "Do not put large amounts in lightning channels.") + warning2 = _("Funds stored in lightning channels are not recoverable from your seed. " + "You must backup your wallet file everytime you create a new channel.") + answer = self.parent.question( + _('Do you want to create your first channel?') + '\n\n' + + _('WARNINGS') + ': ' + '\n\n' + warning1 + '\n\n' + warning2) + if answer: + self.new_channel_dialog() + else: + self.new_channel_dialog() + def statistics_dialog(self): channel_db = self.parent.network.channel_db capacity = self.parent.format_amount(channel_db.capacity()) + ' '+ self.parent.base_unit()