code: func (c *streamFlowController) UpdateHighestReceived(offset protocol.ByteCount, final bool) error {
  	c.mutex.Lock()
  	defer c.mutex.Unlock()
  
  	// If the final offset for this stream is already known, check for consistency.
  	if c.receivedFinalOffset {
  		// If we receive another final offset, check that it's the same.
  		if final && offset != c.highestReceived {
  			return qerr.Error(qerr.FinalSizeError, fmt.Sprintf("Received inconsistent final offset for stream %d (old: %#x, new: %#x bytes)", c.streamID, c.highestReceived, offset))
  		}
  		// Check that the offset is below the final offset.
  		if offset > c.highestReceived {
  			return qerr.Error(qerr.FinalSizeError, fmt.Sprintf("Received offset %#x for stream %d. Final offset was already received at %#x", offset, c.streamID, c.highestReceived))
  		}
  	}
  
  	if final {
  		c.receivedFinalOffset = true
  	}
  	if offset == c.highestReceived {
  		return nil
  	}
  	// A higher offset was received before.
  	// This can happen due to reordering.
  	if offset <= c.highestReceived {
  		if final {
  			return qerr.Error(qerr.FinalSizeError, fmt.Sprintf("Received final offset %#x for stream %d, but already received offset %#x before", offset, c.streamID, c.highestReceived))
  		}
  		return nil
  	}
  
  	increment := offset - c.highestReceived
  	c.highestReceived = offset
  	if c.checkFlowControlViolation() {
  		return qerr.Error(qerr.FlowControlError, fmt.Sprintf("Received %#x bytes on stream %d, allowed %#x bytes", offset, c.streamID, c.receiveWindow))
  	}
  	return c.connection.IncrementHighestReceived(increment)
  }
docs: // UpdateHighestReceived updates the highestReceived value, if the offset is higher.