From ff5074207c84ff34540a282a9b150a8f6dcc3f3c Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 6 Sep 2017 17:35:41 +0200 Subject: [PATCH] scripts: use config in get_peers --- scripts/peers | 1 - scripts/servers | 4 ++-- scripts/util.py | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/peers b/scripts/peers index 0b7939445..3f9610400 100755 --- a/scripts/peers +++ b/scripts/peers @@ -33,7 +33,6 @@ def analyze(results): peers = util.get_peers() results = util.send_request(peers, 'blockchain.headers.subscribe', []) - errors = analyze(results).keys() for n,v in sorted(results.items(), key=lambda x:x[1].get('block_height')): diff --git a/scripts/servers b/scripts/servers index 6af3c7abc..288850ba6 100755 --- a/scripts/servers +++ b/scripts/servers @@ -1,13 +1,13 @@ #!/usr/bin/env python3 -from electrum import SimpleConfig, set_verbosity +from electrum import set_verbosity from electrum.network import filter_protocol from collections import defaultdict import util, json set_verbosity(False) -config = SimpleConfig() + servers = util.get_peers() results = util.send_request(servers, 'blockchain.headers.subscribe', []) diff --git a/scripts/util.py b/scripts/util.py index 8cf86f693..4d4fe9f8e 100644 --- a/scripts/util.py +++ b/scripts/util.py @@ -45,9 +45,10 @@ def wait_on_interfaces(interfaces, timeout=10): return result def get_peers(): + config = SimpleConfig() peers = [] # 1. get connected interfaces - server = 'h.1209k.com:50002:s' + server = config.get('server') interfaces = get_interfaces([server]) if not interfaces: print("No connection to", server)