lightning: call coroutines on callback queue correctly
This commit is contained in:
parent
91083c5f68
commit
3ab42b3606
@ -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"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user