I'm writing a python script using the blockchain API that takes as input a list of seed addresses, gets their transactions and the input/output addresses of each transaction. Then I get the transactions of the new addresses, their transactions and so on. Basically, the script unrolls the k-hop neighborhood of the seed addresses until there are no new neighbors left or a predefined k is met.

A lot of times I get the error "socket.timeout" when calling the getaddr() function. I've tried the following:

while (True):

      data = getaddr()
   except socket.timeout:
      print("Socket timeout. Retrying..")
      time.sleep(20) # Pause for 20 secs. Then retry.

But after a point I keep getting the same error so the loop never ends. Is there something I can do to fix it?


  • 1
    To everyone voting to close this as "customer relationship with a company": I disagree. It's perhaps not a very good question and hard to answer without knowledge of blockchain.info's API, but it is not something that inherently needs that company's support. Anyone familiar with their API could answer it. – Pieter Wuille Feb 4 at 20:56