def _connect(self, connection_function):
    try_factor = 1

    while 1:
      try:
        connection_function()
        return
      except:
        try_factor *= 2

        if try_factor > 512:
          logging.critical('can\'t connect to bitcoind server')
          return

        logging.info('can\'t connect to bitcoind server, waiting {}'.format(try_factor))
        time.sleep(try_factor)
dataset/ETHPy150Open orisi/orisi/src/shared/bitcoind_client/bitcoinclient.py/BitcoinClient._connect/original