improve 'peers' script
[electrum-nvc.git] / scripts / get_history
1 #!/usr/bin/env python
2
3 import sys
4 from electrum import Network
5
6 try:
7     addr = sys.argv[1]
8 except Exception:
9     print "usage: get_history <bitcoin_address>"
10     sys.exit(1)
11
12 n = Network()
13 n.start(wait=True)
14 h = n.synchronous_get([ ('blockchain.address.get_history',[addr]) ])[0]
15 for item in h:
16     print item['tx_hash'], item['height']
17