def check_compiling_node(id): account = Account(droplet_to_uid[id]) ip = droplet_ips[id].decode() s = socket.socket() try: s.connect((ip, 8333)) # VEEERRRRY simple except: # can't connect, check we're not way out in terms of time if int(time.time()) - account.compile_ts.get() > 60 * 180: # 60 min account.add_msg('Possible compile issue (taking >180 minutes). Restarting.') droplets_to_configure.add(id, 0) currently_compiling.remove(id) return s.close() account.add_msg('Node detected! Check at https://getaddr.bitnodes.io/nodes/%s-%d/' % (ip, 8333)) account.email_node_up(ip) logging.info('Detected node %s' % id) currently_compiling.remove(id) nodes_currently_syncing.add(id)