From 8ed812830f8880d02ffb521ff8835bff71d2fa24 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 6 Nov 2012 22:20:54 +0100 Subject: [PATCH] PROTOCOL_VERSION --- lib/interface.py | 10 +++++----- lib/version.py | 7 ++++--- scripts/get_history | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/interface.py b/lib/interface.py index 11ed9f7..d1ea885 100644 --- a/lib/interface.py +++ b/lib/interface.py @@ -20,7 +20,7 @@ import random, socket, ast, re, ssl import threading, traceback, sys, time, json, Queue -from version import ELECTRUM_VERSION +from version import ELECTRUM_VERSION, PROTOCOL_VERSION from util import print_error @@ -106,8 +106,8 @@ class Interface(threading.Thread): if re.match("v(.?)+", v): version = v[1:] try: - is_recent = float(version)>=0.5 - except: + is_recent = float(version)>=float(PROTOCOL_VERSION) + except: is_recent = False if ports and is_recent: servers.append((host, ports)) @@ -293,7 +293,7 @@ class Interface(threading.Thread): if timeout: # ping the server with server.version, as a real ping does not exist yet - self.send([('server.version', [ELECTRUM_VERSION])]) + self.send([('server.version', [ELECTRUM_VERSION, PROTOCOL_VERSION])]) continue out += msg @@ -388,7 +388,7 @@ class Interface(threading.Thread): self.connect_event.set() if self.is_connected: - self.send([('server.version', [ELECTRUM_VERSION, '0.5'])]) + self.send([('server.version', [ELECTRUM_VERSION, PROTOCOL_VERSION])]) self.trigger_callback('connected') else: self.trigger_callback('notconnected') diff --git a/lib/version.py b/lib/version.py index 99b2abd..ded13d0 100644 --- a/lib/version.py +++ b/lib/version.py @@ -1,3 +1,4 @@ -ELECTRUM_VERSION = "1.3" -SEED_VERSION = 4 # bump this everytime the seed generation is modified -TRANSLATION_ID = 32150 # version of the wiki page +ELECTRUM_VERSION = "1.3" # version of the client package +PROTOCOL_VERSION = '0.5' # protocol version requested +SEED_VERSION = 4 # bump this everytime the seed generation is modified +TRANSLATION_ID = 32150 # version of the wiki page diff --git a/scripts/get_history b/scripts/get_history index ac40b2b..9e0b248 100755 --- a/scripts/get_history +++ b/scripts/get_history @@ -9,9 +9,9 @@ except: print "usage: get_history " sys.exit(1) -i = Interface({'server':'electrum.novit.ro:50001:t'}) +i = Interface({'server':'webbtc.com:50001:t'}) i.start() h = i.synchronous_get([ ('blockchain.address.get_history',[addr]) ])[0] for item in h: - print item['tx_hash'], item['value'] + print item['tx_hash'], item['height'] -- 1.7.1