From e41966a37bdfc7e3761912f53196c71fff85b88c Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 15 Jun 2012 08:29:52 +0200 Subject: [PATCH] catch keyboard interrupt --- blocks | 5 ++++- get_history | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/blocks b/blocks index 5491d2c29..2de192e1d 100755 --- a/blocks +++ b/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') diff --git a/get_history b/get_history index 32641152e..50c10a937 100755 --- a/get_history +++ b/get_history @@ -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