mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
kivy: fix channel list error handling, close functionality for inactive channels
This commit is contained in:
parent
1a05838ef2
commit
6aebc0fd5d
1 changed files with 6 additions and 3 deletions
|
@ -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()
|
||||
for i in res["channels"]:
|
||||
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…
Add table
Reference in a new issue