remove unused things

This commit is contained in:
Victor Shyba 2019-08-07 01:56:28 -03:00
parent f04c5ee902
commit 822f53c888

View file

@ -108,7 +108,7 @@ class BaseNetwork:
try: try:
self.client = await self.session_pool.wait_for_fastest_session() self.client = await self.session_pool.wait_for_fastest_session()
self._update_remote_height((await self.subscribe_headers(),)) self._update_remote_height((await self.subscribe_headers(),))
log.info("Successfully connected to SPV wallet server: %s:%d", *self.client.server) log.info("Switching to SPV wallet server: %s:%d", *self.client.server)
self._on_connected_controller.add(True) self._on_connected_controller.add(True)
self.client.on_disconnected.listen(lambda _: self.switch_event.set()) self.client.on_disconnected.listen(lambda _: self.switch_event.set())
await self.switch_event.wait() await self.switch_event.wait()
@ -118,8 +118,6 @@ class BaseNetwork:
raise raise
except asyncio.TimeoutError: except asyncio.TimeoutError:
pass pass
except Exception: # pylint: disable=broad-except
log.exception("Exception while trying to find a server!")
async def stop(self): async def stop(self):
self.running = False self.running = False
@ -143,10 +141,6 @@ class BaseNetwork:
else: else:
raise ConnectionError("Attempting to send rpc request when connection is not available.") raise ConnectionError("Attempting to send rpc request when connection is not available.")
async def probe_session(self, session: ClientSession):
await session.send_request('server.banner')
return session
def _update_remote_height(self, header_args): def _update_remote_height(self, header_args):
self.remote_height = header_args[0]["height"] self.remote_height = header_args[0]["height"]
@ -215,7 +209,6 @@ class SessionPool:
task.add_done_callback(lambda _: self.ensure_connections()) task.add_done_callback(lambda _: self.ensure_connections())
self.sessions[session] = task self.sessions[session] = task
async def wait_for_fastest_session(self): async def wait_for_fastest_session(self):
while True: while True:
fastest = self.fastest_session fastest = self.fastest_session