commit 863fe031f0e9dfa5376b78354e554a317c3b2d90
parent 2eb02931aea1d4bf0c869284959bdb9b584f19f4
Author: bitromortac <bitromortac@protonmail.com>
Date: Fri, 1 Jan 2021 10:12:07 +0100
lnpeer: await on_message handlers to raise exceptions
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py
@@ -193,7 +193,7 @@ class Peer(Logger):
payload['raw'] = message
execution_result = f(*args)
if asyncio.iscoroutinefunction(f):
- asyncio.ensure_future(execution_result)
+ asyncio.ensure_future(self.taskgroup.spawn(execution_result))
def on_error(self, payload):
self.logger.info(f"remote peer sent error [DO NOT TRUST THIS MESSAGE]: {payload['data'].decode('ascii')}")
@@ -1405,7 +1405,6 @@ class Peer(Logger):
self.logger.info(f'({chan.get_id_for_log()}) Channel closed {txid}')
return txid
- @log_exceptions
async def on_shutdown(self, chan: Channel, payload):
their_scriptpubkey = payload['scriptpubkey']
# BOLT-02 restrict the scriptpubkey to some templates: