SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
3 changed files with
13 additions and
8 deletions
-
electrum/gui/kivy/main_window.py
-
electrum/gui/kivy/uix/dialogs/lightning_channels.py
-
electrum/lnworker.py
|
|
@ -188,6 +188,7 @@ class ElectrumWindow(App, Logger): |
|
|
|
use_gossip = BooleanProperty(False) |
|
|
|
def on_use_gossip(self, instance, x): |
|
|
|
self.electrum_config.set_key('use_gossip', self.use_gossip, True) |
|
|
|
if self.network: |
|
|
|
if self.use_gossip: |
|
|
|
self.network.start_gossip() |
|
|
|
else: |
|
|
|
|
|
@ -172,6 +172,7 @@ Builder.load_string(r''' |
|
|
|
<LightningChannelsDialog@Popup>: |
|
|
|
name: 'lightning_channels' |
|
|
|
title: _('Lightning Network') |
|
|
|
has_network: False |
|
|
|
has_lightning: False |
|
|
|
has_gossip: False |
|
|
|
can_send: '' |
|
|
@ -205,13 +206,13 @@ Builder.load_string(r''' |
|
|
|
size_hint: 0.3, None |
|
|
|
height: '48dp' |
|
|
|
text: _('Open Channel') |
|
|
|
disabled: not root.has_lightning |
|
|
|
disabled: not (root.has_network and root.has_lightning) |
|
|
|
on_release: popup.app.popup_dialog('lightning_open_channel_dialog') |
|
|
|
Button: |
|
|
|
size_hint: 0.3, None |
|
|
|
height: '48dp' |
|
|
|
text: _('Swap') |
|
|
|
disabled: not root.has_lightning |
|
|
|
disabled: not (root.has_network and root.has_lightning) |
|
|
|
on_release: popup.app.popup_dialog('swap_dialog') |
|
|
|
Button: |
|
|
|
size_hint: 0.3, None |
|
|
@ -589,8 +590,9 @@ class LightningChannelsDialog(Factory.Popup): |
|
|
|
super(LightningChannelsDialog, self).__init__() |
|
|
|
self.clocks = [] |
|
|
|
self.app = app |
|
|
|
self.has_network = bool(self.app.network) |
|
|
|
self.has_lightning = app.wallet.has_lightning() |
|
|
|
self.has_gossip = self.app.network.channel_db is not None |
|
|
|
self.has_gossip = self.has_network and self.app.network.channel_db is not None |
|
|
|
self.update() |
|
|
|
|
|
|
|
def show_item(self, obj): |
|
|
|
|
|
@ -845,6 +845,8 @@ class LNWallet(LNWorker): |
|
|
|
item = chan.get_funding_height() |
|
|
|
if item is None: |
|
|
|
continue |
|
|
|
if not self.lnwatcher: |
|
|
|
continue # lnwatcher not available with --offline (its data is not persisted) |
|
|
|
funding_txid, funding_height, funding_timestamp = item |
|
|
|
tx_height = self.lnwatcher.get_tx_height(funding_txid) |
|
|
|
item = { |
|
|
|