Browse Source

kivy: fix channel list error handling, close functionality for inactive channels

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

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

@ -37,7 +37,7 @@ class LightningChannelsDialog(Factory.Popup):
def close_channel(self, obj):
print("asked to close channel", obj.channelPoint)
lightning.lightningCall(self.app.wallet.network.lightningrpc, "closechannel")(obj.channelPoint + (" --force" if not obj.active else ""))
lightning.lightningCall(self.app.wallet.network.lightningrpc, "closechannel")(*([obj.channelPoint] + (["--force"] if not obj.active else [])))
def show_menu(self, obj):
self.hide_menu()
@ -69,10 +69,13 @@ class LightningChannelsDialog(Factory.Popup):
raise res
channel_cards = self.ids.lightning_channels_container
channel_cards.clear_widgets()
if "channels" in res:
for i in res["channels"]:
item = Factory.LightningChannelItem()
item.screen = self
print(i)
item.channelPoint = binascii.hexlify(bytes(reversed(bytes(bytearray.fromhex(i["channel_point"].split(":")[0]))))).decode("ascii")
item.channelPoint = i["channel_point"].split(":")[0]
item.active = i["active"]
channel_cards.add_widget(item)
else:
self.app.show_info(res)

Loading…
Cancel
Save