lightning: call coroutines on callback queue correctly

This commit is contained in:
Janus 2018-02-15 12:18:01 +01:00
parent 91083c5f68
commit 3ab42b3606

View File

@ -588,7 +588,12 @@ class Network(util.DaemonThread):
await self.on_get_header(interface, response)
for callback in callbacks:
callback(response)
if asyncio.iscoroutinefunction(callback):
if response is None:
print("RESPONSE IS NONE")
await callback(response)
else:
callback(response)
def get_index(self, method, params):
""" hashable index for subscriptions and cache"""