From 565e2858aff58e882c62719fced34a1679161011 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 2 May 2013 16:28:58 +0400 Subject: [PATCH] wait until bitcoind is ready on startup --- backends/bitcoind/blockchain_processor.py | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index d95764e..174d186 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -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 -- 1.7.1