commit ff5074207c84ff34540a282a9b150a8f6dcc3f3c
parent 29aaa1c4c4543519a26c625ddd336f2f6364989a
Author: ThomasV <thomasv@electrum.org>
Date: Wed, 6 Sep 2017 17:35:41 +0200
scripts: use config in get_peers
Diffstat:
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git 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
@@ -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
@@ -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)