catch keyboard interrupt
authorThomasV <thomasv@gitorious>
Fri, 15 Jun 2012 06:29:52 +0000 (08:29 +0200)
committerThomasV <thomasv@gitorious>
Fri, 15 Jun 2012 06:29:52 +0000 (08:29 +0200)
blocks
get_history

diff --git a/blocks b/blocks
index 5491d2c..2de192e 100755 (executable)
--- 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')
index 3264115..50c10a9 100755 (executable)
@@ -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