electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit fff922b5d70a3bd7ceba52785747ff08afb6acb4
parent 97b726386e711162b1dd8d88814198cc772dcecc
Author: ThomasV <thomasv@gitorious>
Date:   Sat, 20 Oct 2012 17:21:12 +0200

fix: random_choice -> random.choice

Diffstat:
Mlib/interface.py | 2+-
Mscripts/servers | 7++++++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/interface.py b/lib/interface.py @@ -40,7 +40,7 @@ proxy_modes = ['socks4', 'socks5', 'http'] def pick_random_server(): - return random_choice( DEFAULT_SERVERS ) + return random.choice( DEFAULT_SERVERS ) def pick_random_interface(): servers = DEFAULT_SERVERS diff --git a/scripts/servers b/scripts/servers @@ -13,6 +13,7 @@ for i in interfaces: i.send([('blockchain.numblocks.subscribe',[])]) else: servers.remove(i.server) + i.status = "unreachable" for i in interfaces: while True: @@ -23,11 +24,12 @@ for i in interfaces: if r.get('method') == 'blockchain.numblocks.subscribe': results.append((i.host, r.get('result'))) + i.status = "ok" servers.remove(i.server) break for s in servers: - print "%30s "%s, "timed out" + i.status = "timed out" from collections import defaultdict d = defaultdict(int) @@ -36,6 +38,9 @@ for e in results: v = d.values() numblocks = d.keys()[v.index(max(v))] +for i in interfaces: + print i.host, i.status + for s,n in results: print "%30s %d "%(s, n), "ok" if abs(n-numblocks)<2 else "lagging"