1
0

move daemon spawning code into NetworkProxy class

This commit is contained in:
ThomasV
2014-03-16 12:00:08 +01:00
parent 0bb16f0836
commit 7dd296273f
3 changed files with 48 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python
import sys
from electrum import Network
from electrum import NetworkProxy, print_json
try:
addr = sys.argv[1]
@@ -9,9 +9,8 @@ except Exception:
print "usage: get_history <bitcoin_address>"
sys.exit(1)
n = Network()
n.start(wait=True)
n = NetworkProxy()
n.start(start_daemon=True)
h = n.synchronous_get([ ('blockchain.address.get_history',[addr]) ])[0]
for item in h:
print item['tx_hash'], item['height']
print_json(h)