1
0

synchronous_get batch method for interface

This commit is contained in:
thomasv
2012-10-19 14:16:02 +02:00
parent 2137ab3238
commit e165c13a84
3 changed files with 37 additions and 47 deletions

View File

@@ -11,18 +11,7 @@ except:
i = Interface({'server':'electrum.novit.ro:50001:t'})
i.start()
i.send([('blockchain.address.get_history',[addr])])
h = i.synchronous_get([ ('blockchain.address.get_history',[addr]) ])[0]
for item in h:
print item['tx_hash'], item['value']
while True:
try:
r = i.responses.get(True, 100000000000)
except KeyboardInterrupt:
break
method = r.get('method')
if method == 'blockchain.address.get_history':
confirmed = unconfirmed = 0
h = r.get('result')
for item in h:
print item['tx_hash'], item['value']
break