From: ThomasV Date: Fri, 24 Jan 2014 10:34:26 +0000 (+0100) Subject: fixes X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=dec881f99cdda62dfe0459d55a2be129ba491bae fixes --- diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index cf5f609..1de5db6 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -640,7 +640,10 @@ class BlockchainProcessor(Processor): self.mtimes['import'] = 0 if prh: - assert prh == self.storage.get_root_hash().encode('hex') + if prh != self.storage.get_root_hash().encode('hex'): + print_log("root hash error", prh) + self.shared.stop() + raise prh = None else: diff --git a/transports/stratum_tcp.py b/transports/stratum_tcp.py index aad4c17..cae116c 100644 --- a/transports/stratum_tcp.py +++ b/transports/stratum_tcp.py @@ -128,7 +128,7 @@ class TcpClientRequestor(threading.Thread): try: command = json.loads(raw_command) except: - self.dispatcher.push_response({"error": "bad JSON", "request": raw_command}) + self.dispatcher.push_response(self.session, {"error": "bad JSON", "request": raw_command}) return True try: @@ -138,7 +138,7 @@ class TcpClientRequestor(threading.Thread): method = command['method'] except KeyError: # Return an error JSON in response. - self.dispatcher.push_response({"error": "syntax error", "request": raw_command}) + self.dispatcher.push_response(self.session, {"error": "syntax error", "request": raw_command}) else: self.dispatcher.push_request(self.session, command) # sleep a bit to prevent a single session from DOSing the queue