tDebug cleanups. - obelisk - Electrum server using libbitcoin as its backend
git clone https://git.parazyd.org/obelisk
Log
Files
Refs
README
LICENSE
---
commit 183262b72ecf87b10446f75068cb4b5f4668108e
parent 9b6accd058e54b69c16596c303fa67682134f34c
Author: parazyd 
Date:   Wed,  7 Apr 2021 19:14:35 +0200

Debug cleanups.

Diffstat:
  M electrumobelisk/protocol.py         |       9 ++++++---

1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/electrumobelisk/protocol.py b/electrumobelisk/protocol.py
t@@ -171,7 +171,7 @@ class ElectrumProtocol(asyncio.Protocol):  # pylint: disable=R0904,R0902
 
         _ec, data = await self.bx.fetch_block_header(index)
         if _ec and _ec != 0:
-            self.log.debug("Got error: {_ec}")
+            self.log.debug("Got error: %s", repr(_ec))
             return {"error": "request corrupted"}
         return {"result": safe_hexlify(data)}
 
t@@ -195,7 +195,7 @@ class ElectrumProtocol(asyncio.Protocol):  # pylint: disable=R0904,R0902
         for i in range(count):
             _ec, data = await self.bx.fetch_block_header(i)
             if _ec and _ec != 0:
-                self.log.debug("Got error: {_ec}")
+                self.log.debug("Got error: %s", repr(_ec))
                 return {"error": "request corrupted"}
             headers.extend(data)
 
t@@ -309,6 +309,9 @@ class ElectrumProtocol(asyncio.Protocol):  # pylint: disable=R0904,R0902
             client_min = client_max = client_ver
         version = min(client_max, SERVER_PROTO_MAX)
         if version < max(client_min, SERVER_PROTO_MIN):
-            return {"error": f"client protocol version {client_ver} is not supported"}
+            return {
+                "error":
+                f"client protocol version {client_ver} is not supported"
+            }
         self.version_called = True
         return {"response": [f"obelisk {VERSION}", version]}