Browse Source
interface: change close() implementation
was getting on lightning branch in some circumstances
RecursionError: maximum recursion depth exceeded while calling a Python object
3.3.3.1
SomberNight
6 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
4 additions and
2 deletions
-
electrum/interface.py
|
@ -247,7 +247,7 @@ class Interface(PrintError): |
|
|
return sslc |
|
|
return sslc |
|
|
|
|
|
|
|
|
def handle_disconnect(func): |
|
|
def handle_disconnect(func): |
|
|
async def wrapper_func(self, *args, **kwargs): |
|
|
async def wrapper_func(self: 'Interface', *args, **kwargs): |
|
|
try: |
|
|
try: |
|
|
return await func(self, *args, **kwargs) |
|
|
return await func(self, *args, **kwargs) |
|
|
except GracefulDisconnect as e: |
|
|
except GracefulDisconnect as e: |
|
@ -380,7 +380,9 @@ class Interface(PrintError): |
|
|
await self.session.send_request('server.ping') |
|
|
await self.session.send_request('server.ping') |
|
|
|
|
|
|
|
|
async def close(self): |
|
|
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): |
|
|
async def run_fetch_blocks(self): |
|
|
header_queue = asyncio.Queue() |
|
|
header_queue = asyncio.Queue() |
|
|