catch keyboard interrupt
This commit is contained in:
5
blocks
5
blocks
@@ -8,6 +8,9 @@ i.start()
|
|||||||
i.send([('blockchain.numblocks.subscribe',[])])
|
i.send([('blockchain.numblocks.subscribe',[])])
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
r = i.responses.get(True, 100000000000)
|
try:
|
||||||
|
r = i.responses.get(True, 100000000000)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
break
|
||||||
if r.get('method') == 'blockchain.numblocks.subscribe':
|
if r.get('method') == 'blockchain.numblocks.subscribe':
|
||||||
print r.get('result')
|
print r.get('result')
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ i.start()
|
|||||||
i.send([('blockchain.address.get_history',[addr])])
|
i.send([('blockchain.address.get_history',[addr])])
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
r = i.responses.get(True, 100000000000)
|
try:
|
||||||
|
r = i.responses.get(True, 100000000000)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
break
|
||||||
method = r.get('method')
|
method = r.get('method')
|
||||||
if method == 'blockchain.address.get_history':
|
if method == 'blockchain.address.get_history':
|
||||||
confirmed = unconfirmed = 0
|
confirmed = unconfirmed = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user