tFix bug involving deprecated protocol method - electrum-personal-server - Maximally lightweight electrum server for a single user
git clone https://git.parazyd.org/electrum-personal-server
Log
Files
Refs
README
---
commit 2be15670383b738770ef42b9a0d8f84a6341660e
parent 3ffb6307d76f7aad3a844dfa2fd368242664f6c7
Author: chris-belcher 
Date:   Mon, 12 Nov 2018 13:44:50 +0000

Fix bug involving deprecated protocol method

The method blockchain.blocks.get_header can only ever return non-raw
headers, so the protocol state are_headers_raw shouldnt be respected
tthere.

Diffstat:
  M electrumpersonalserver/server/comm… |       4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/electrumpersonalserver/server/common.py b/electrumpersonalserver/server/common.py
t@@ -181,6 +181,7 @@ def handle_query(sock, line, rpc, txmonitor):
                     else True)
         elif protocol_version[0] == 1.4:
             are_headers_raw[0] = True
+        logger.debug("are_headers_raw = " + str(are_headers_raw[0]))
         subscribed_to_headers[0] = True
         new_bestblockhash, header = get_current_header(rpc, are_headers_raw[0])
         send_response(sock, query, header)
t@@ -188,7 +189,8 @@ def handle_query(sock, line, rpc, txmonitor):
         height = query["params"][0]
         try:
             blockhash = rpc.call("getblockhash", [height])
-            header = get_block_header(rpc, blockhash, are_headers_raw[0])
+            #this deprecated method (as of 1.3) can only return non-raw headers
+            header = get_block_header(rpc, blockhash, False)
             send_response(sock, query, header)
         except JsonRpcError:
             error = {"message": "height " + str(height) + " out of range",