mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
catch keyboard interrupt
This commit is contained in:
parent
1084abeb53
commit
e41966a37b
2 changed files with 8 additions and 2 deletions
5
blocks
5
blocks
|
@ -8,6 +8,9 @@ i.start()
|
|||
i.send([('blockchain.numblocks.subscribe',[])])
|
||||
|
||||
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':
|
||||
print r.get('result')
|
||||
|
|
|
@ -15,7 +15,10 @@ i.start()
|
|||
i.send([('blockchain.address.get_history',[addr])])
|
||||
|
||||
while True:
|
||||
r = i.responses.get(True, 100000000000)
|
||||
try:
|
||||
r = i.responses.get(True, 100000000000)
|
||||
except KeyboardInterrupt:
|
||||
break
|
||||
method = r.get('method')
|
||||
if method == 'blockchain.address.get_history':
|
||||
confirmed = unconfirmed = 0
|
||||
|
|
Loading…
Add table
Reference in a new issue