From 5f733a43122419ccc73684639641f49d0c878774 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 17 May 2012 20:26:37 +0200 Subject: [PATCH] add init_socket to scripts --- blocks | 4 +++- watch_address | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/blocks b/blocks index cf03340b..5491d2c2 100755 --- a/blocks +++ b/blocks @@ -3,9 +3,11 @@ from electrum import TcpStratumInterface i = TcpStratumInterface('ecdsa.org', 50001) +i.init_socket() i.start() i.send([('blockchain.numblocks.subscribe',[])]) while True: r = i.responses.get(True, 100000000000) - print r.get('result') + if r.get('method') == 'blockchain.numblocks.subscribe': + print r.get('result') diff --git a/watch_address b/watch_address index 41d2051c..698d9b48 100755 --- a/watch_address +++ b/watch_address @@ -9,6 +9,7 @@ except: print "usage: watch_address " i = TcpStratumInterface('ecdsa.org', 50001) +i.init_socket() i.start() i.send([('blockchain.address.subscribe',[addr])])