From 118052d81597eff3eb636d242eacdd0437dabdd6 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 27 Jun 2015 15:22:34 +0200 Subject: [PATCH] v2.4 will require protocol v0.10 --- lib/network.py | 2 +- lib/util.py | 3 +++ lib/version.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/network.py b/lib/network.py index 326bd6842..4cf75c01c 100644 --- a/lib/network.py +++ b/lib/network.py @@ -59,7 +59,7 @@ def parse_servers(result): pruning_level = v[1:] if pruning_level == '': pruning_level = '0' try: - is_recent = float(version)>=float(PROTOCOL_VERSION) + is_recent = cmp(util.normalize_version(version), util.normalize_version(PROTOCOL_VERSION)) >= 0 except Exception: is_recent = False diff --git a/lib/util.py b/lib/util.py index 22dc3887c..82446554a 100644 --- a/lib/util.py +++ b/lib/util.py @@ -7,6 +7,9 @@ import urlparse import urllib import threading +def normalize_version(v): + return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")] + class NotEnoughFunds(Exception): pass class InvalidPassword(Exception): diff --git a/lib/version.py b/lib/version.py index 1e884faa7..2b3e6ee3e 100644 --- a/lib/version.py +++ b/lib/version.py @@ -1,5 +1,5 @@ -ELECTRUM_VERSION = "2.3.3" # version of the client package -PROTOCOL_VERSION = '0.9' # protocol version requested +ELECTRUM_VERSION = "2.4" # version of the client package +PROTOCOL_VERSION = '0.10' # protocol version requested NEW_SEED_VERSION = 11 # electrum versions >= 2.0 OLD_SEED_VERSION = 4 # electrum versions < 2.0