def METHOD_NAME(self, node, block_hash):
    t = time()
    while time() - t < 30:
        try:
            block = node.getblock(block_hash)
            if block["confirmations"] > 0 and block["chainlock"]:
                return
        except:
            # block might not be on the node yet
            pass
        sleep(0.1)
    raise AssertionError("wait_for_chainlock timed out")