tadd init_socket to scripts - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 5f733a43122419ccc73684639641f49d0c878774 (DIR) parent f8ce5b65df4b36cf802915cd9a09e482de456d99 (HTM) Author: ThomasV <thomasv@gitorious> Date: Thu, 17 May 2012 20:26:37 +0200 add init_socket to scripts Diffstat: M blocks | 4 +++- M watch_address | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) --- (DIR) diff --git a/blocks b/blocks t@@ -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') (DIR) diff --git a/watch_address b/watch_address t@@ -9,6 +9,7 @@ except: print "usage: watch_address <bitcoin_address>" i = TcpStratumInterface('ecdsa.org', 50001) +i.init_socket() i.start() i.send([('blockchain.address.subscribe',[addr])])