From: ThomasV Date: Sun, 4 Nov 2012 21:45:20 +0000 (+0400) Subject: client sends protocol version X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=6037a6adcdb140a5a8b291d8d761bee2da320809;hp=5f23ed78162f41e990cb3fcb30e9606a15a8d3a6 client sends protocol version --- diff --git a/processor.py b/processor.py index 3761332..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()