commit b3ff173b4507e8325c65d607a4547320ba2c8798
parent 762082e13d7e9db7c1ca603a04d9dc1aebe8b0af
Author: SomberNight <somber.night@protonmail.com>
Date: Sun, 9 Dec 2018 20:02:00 +0100
interface: change close() implementation
was getting on lightning branch in some circumstances
RecursionError: maximum recursion depth exceeded while calling a Python object
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/electrum/interface.py b/electrum/interface.py
@@ -247,7 +247,7 @@ class Interface(PrintError):
return sslc
def handle_disconnect(func):
- async def wrapper_func(self, *args, **kwargs):
+ async def wrapper_func(self: 'Interface', *args, **kwargs):
try:
return await func(self, *args, **kwargs)
except GracefulDisconnect as e:
@@ -380,7 +380,9 @@ class Interface(PrintError):
await self.session.send_request('server.ping')
async def close(self):
- await self.group.cancel_remaining()
+ if self.session:
+ await self.session.close()
+ # monitor_connection will cancel tasks
async def run_fetch_blocks(self):
header_queue = asyncio.Queue()