def METHOD_NAME(self):
    """
    Remove messages that are no longer relevant, based on the last
    sequence number received.
    """
    min_sequence = (self._last_received_sequence_number -
                    self._n_sequences_per_transmission)
    logger.debug("Removing buffers between {} and {}",
                 min_sequence, self._last_received_sequence_number)
    # If we are at the start of the sequence numbers, keep going back up to
    # the allowed window
    if min_sequence < 0:
        back_min_sequence = min_sequence + _N_SEQUENCES
        while (self._buffers_sent and
                self._buffers_sent[0].sequence_no > back_min_sequence):
            logger.debug("Removing buffer with sequence {}",
                         self._buffers_sent[0].sequence_no)
            self._buffers_sent.popleft()
    # Go back through the queue until we reach the last received sequence
    while (self._buffers_sent and
            min_sequence < self._buffers_sent[0].sequence_no <=
            self._last_received_sequence_number):
        logger.debug("Removing buffer with sequence {}",
                     self._buffers_sent[0].sequence_no)
        self._buffers_sent.popleft()