X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=processor.py;h=1ea96495765f7af1217506fc9a3e0b05bae015ec;hb=d59253c43af31da62b0fa247a54ab632e7473976;hp=d9827fdbf15cab4b3fd13f0ecf1c9d2eb0a06d7d;hpb=8d67149bdc44000fb70604498071ee97607550ba;p=electrum-server.git diff --git a/processor.py b/processor.py index d9827fd..1ea9649 100644 --- a/processor.py +++ b/processor.py @@ -164,6 +164,7 @@ class Session: self.subscriptions = [] self.address = '' self.name = '' + self.version = 'unknown' threading.Timer(2, self.info).start() # Debugging method. Doesn't need to be threadsafe. @@ -172,13 +173,14 @@ class Session: #print sub method = sub[0] if method == 'blockchain.address.subscribe': - params = sub[1] - addr = params[0] + addr = sub[1] break else: addr = None - print timestr(), self.name, self.address, addr,\ - len(self.subscriptions), self.version + + if self.subscriptions: + print timestr(), self.name, self.address, addr,\ + len(self.subscriptions), self.version def stopped(self): with self.lock: @@ -195,7 +197,7 @@ class Session: def build_subdesc(method, params): if method == "blockchain.numblocks.subscribe": return method, - elif method == "blockchain.address.get_history": + elif method == "blockchain.address.subscribe": if not params: return None else: @@ -246,6 +248,9 @@ class ResponseDispatcher(threading.Thread): def send_response(self, internal_id, response): session, message_id = self.processor.get_session_id(internal_id) - response['id'] = message_id - session.send_response(response) + if session: + response['id'] = message_id + session.send_response(response) + else: + print "send_response: no session", message_id, internal_id, response