From: ThomasV Date: Thu, 2 May 2013 12:28:58 +0000 (+0400) Subject: wait until bitcoind is ready on startup X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=565e2858aff58e882c62719fced34a1679161011 wait until bitcoind is ready on startup --- 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