From 5e8d169c50b7568b2cba7e88a4546b91fda1de8d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 22 Aug 2019 14:35:22 -0400 Subject: [PATCH] debug --- torba/torba/client/basenetwork.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/torba/torba/client/basenetwork.py b/torba/torba/client/basenetwork.py index 38ff07b5a..4ff0d63e0 100644 --- a/torba/torba/client/basenetwork.py +++ b/torba/torba/client/basenetwork.py @@ -54,14 +54,18 @@ class ClientSession(BaseClientSession): return result async def send_request(self, method, args=(), timeout=None): + log.info("send %s to %s:%i", method, *self.server) timeout = timeout or self.timeout self.pending_amount += 1 try: if method == 'server.version': - return await self.send_timed_server_version_request(args, timeout) - return await asyncio.wait_for( - super().send_request(method, args), timeout=timeout - ) + reply = await self.send_timed_server_version_request(args, timeout) + else: + reply = await asyncio.wait_for( + super().send_request(method, args), timeout=timeout + ) + log.info("got reply for %s from %s:%i", method, *self.server) + return reply except RPCError as e: log.warning("Wallet server (%s:%i) returned an error. Code: %s Message: %s", *self.server, *e.args) @@ -71,8 +75,10 @@ class ClientSession(BaseClientSession): self.synchronous_close() raise asyncio.CancelledError(f"connection to {self.server[0]}:{self.server[1]} lost") except asyncio.TimeoutError: + log.info("timeout sending %s to %s:%i", method, *self.server) raise except asyncio.CancelledError: + log.info("cancelled sending %s to %s:%i", method, *self.server) self.synchronous_close() raise finally: