GC connections in wallet (#10450)

This commit is contained in:
Mariano Sorgente 2022-02-26 18:31:10 -05:00 committed by GitHub
parent d245790a17
commit e8475fb194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,7 +208,9 @@ class ChiaServer:
await asyncio.sleep(600 if is_crawler is None else 2)
to_remove: List[WSChiaConnection] = []
for connection in self.all_connections.values():
if self._local_type == NodeType.FULL_NODE and connection.connection_type == NodeType.FULL_NODE:
if (
self._local_type == NodeType.FULL_NODE or self._local_type == NodeType.WALLET
) and connection.connection_type == NodeType.FULL_NODE:
if is_crawler is not None:
if time.time() - connection.creation_time > 5:
to_remove.append(connection)