wait until bitcoind is ready on startup
[electrum-server.git] / 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