1
0

lightning: complete moving of lightning objects, acquire net/wallet lock while answering lightning requests

This commit is contained in:
Janus
2018-03-15 17:38:02 +01:00
committed by ThomasV
parent 98f6f67c6b
commit d84eab0418
6 changed files with 51 additions and 14 deletions

View File

@@ -31,12 +31,12 @@ class LightningChannelsDialog(Factory.Popup):
super(LightningChannelsDialog, self).open(*args, **kwargs)
for i in self.clocks: i.cancel()
self.clocks.append(Clock.schedule_interval(self.fetch_channels, 10))
self.app.wallet.lightning.subscribe(self.rpc_result_handler)
self.app.wallet.network.lightningrpc.subscribe(self.rpc_result_handler)
def dismiss(self, *args, **kwargs):
super(LightningChannelsDialog, self).dismiss(*args, **kwargs)
self.app.wallet.lightning.clearSubscribers()
self.app.wallet.network.lightningrpc.clearSubscribers()
def fetch_channels(self, dw):
lightning.lightningCall(self.app.wallet.lightning, "listchannels")()
lightning.lightningCall(self.app.wallet.network.lightningrpc, "listchannels")()
def rpc_result_handler(self, res):
if isinstance(res, Exception):
raise res