wait until bitcoind is ready on startup
authorThomasV <thomasv@gitorious>
Thu, 2 May 2013 12:28:58 +0000 (16:28 +0400)
committerThomasV <thomasv@gitorious>
Thu, 2 May 2013 12:28:58 +0000 (16:28 +0400)
backends/bitcoind/blockchain_processor.py

index d95764e..174d186 100644 (file)
@@ -53,6 +53,15 @@ class BlockchainProcessor(Processor):
             config.get('bitcoind', 'host'),
             config.get('bitcoind', 'port'))
 
+        while True:
+            try:
+                self.bitcoind('getinfo')
+                break
+            except:
+                print_log('cannot contact bitcoind...')
+                time.sleep(5)
+                continue
+
         self.height = 0
         self.is_test = False
         self.sent_height = 0