X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=processor.py;h=8596625e7b92a8d53acaad3186818d48f616e918;hb=6037a6adcdb140a5a8b291d8d761bee2da320809;hp=839a770651a4215cbbf95856e4c67948994a65ad;hpb=c293b5a5d4e71f555981ba934ec53dedcce36fea;p=electrum-server.git diff --git a/processor.py b/processor.py index 839a770..8596625 100644 --- a/processor.py +++ b/processor.py @@ -139,10 +139,7 @@ class RequestDispatcher(threading.Thread): params = request.get('params',[]) suffix = method.split('.')[-1] - try: - is_new = float(session.version) >= 1.3 - except: - is_new = False + is_new = session.protocol_version >= 0.5 if is_new and method == 'blockchain.address.get_history': method = 'blockchain.address.get_history2' @@ -169,6 +166,10 @@ class RequestDispatcher(threading.Thread): if method in ['server.version']: session.version = params[0] + try: + session.protocol_version = float(params[1]) + except: + pass def get_sessions(self): with self.lock: @@ -201,6 +202,7 @@ class Session: self.address = '' self.name = '' self.version = 'unknown' + self.protocol_version = 0. self.time = time.time() threading.Timer(2, self.info).start() @@ -268,6 +270,9 @@ class ResponseDispatcher(threading.Thread): method = response.get('method') params = response.get('params') + if method == "blockchain.address.subscribe2": + method = "blockchain.address.subscribe" + # A notification if internal_id is None: # and method is not None and params is not None: self.notification(method, params, response)