Browse Source

lightning: fix channels dialog

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
Janus 7 years ago
committed by ThomasV
parent
commit
ffe6342882
  1. 10
      gui/kivy/uix/dialogs/lightning_channels.py

10
gui/kivy/uix/dialogs/lightning_channels.py

@ -1,5 +1,7 @@
from kivy.lang import Builder from kivy.lang import Builder
from kivy.factory import Factory from kivy.factory import Factory
from kivy.clock import Clock
import electrum.lightning as lightning
Builder.load_string(''' Builder.load_string('''
<LightningChannelItem@CardItem> <LightningChannelItem@CardItem>
@ -37,13 +39,15 @@ class LightningChannelsDialog(Factory.Popup):
self.app.wallet.network.lightningrpc.clearSubscribers() self.app.wallet.network.lightningrpc.clearSubscribers()
def fetch_channels(self, dw): def fetch_channels(self, dw):
lightning.lightningCall(self.app.wallet.network.lightningrpc, "listchannels")() lightning.lightningCall(self.app.wallet.network.lightningrpc, "listchannels")()
def rpc_result_handler(self, res): def rpc_result_handler(self, methodName, res):
print("got result", methodName)
if isinstance(res, Exception): if isinstance(res, Exception):
raise res raise res
channel_cards = self.ids.lightning_channels_container channel_cards = self.ids.lightning_channels_container
channels_cards.clear_widgets() channel_cards.clear_widgets()
for i in res["channels"]: for i in res["channels"]:
item = Factory.LightningChannelItem() item = Factory.LightningChannelItem()
item.screen = self item.screen = self
item.channelId = i.channelId print(i)
item.channelId = i["chan_id"]
channel_cards.add_widget(item) channel_cards.add_widget(item)

Loading…
Cancel
Save