commit 40ceabff799c98dc7dd7f260d667550b4622ca9a
parent 69a204d72600d7a2a58917cb4fe705ab438d4437
Author: SomberNight <somber.night@protonmail.com>
Date: Wed, 5 Sep 2018 18:36:13 +0200
rm redundant function from util
Diffstat:
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/electrum/network.py b/electrum/network.py
@@ -83,7 +83,7 @@ def parse_servers(result):
def filter_version(servers):
def is_recent(version):
try:
- return util.normalize_version(version) >= util.normalize_version(PROTOCOL_VERSION)
+ return util.versiontuple(version) >= util.versiontuple(PROTOCOL_VERSION)
except Exception as e:
return False
return {k: v for k, v in servers.items() if is_recent(v.get('version'))}
diff --git a/electrum/util.py b/electrum/util.py
@@ -71,9 +71,6 @@ def base_unit_name_to_decimal_point(unit_name: str) -> int:
raise UnknownBaseUnit(unit_name) from None
-def normalize_version(v):
- return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
-
class NotEnoughFunds(Exception): pass