def matched_in_prev_blocks(gid, current_start, block_nodes):
    """
    check whether gateway with gid is matched in previous block
    :param gid:
    :param current_start:
    :param block_nodes:
    :return:
    """
    prev_nodes = set()
    for prev_start, nodes in block_nodes.items():
        if prev_start == current_start:
            continue
        prev_nodes.update(nodes)

    return gid in prev_nodes