code: func (c *msgsCache) add(seq uint64, msg *pb.MsgProto, isNew bool) {
  	exp := cacheTTL
  	if isNew {
  		exp += msg.Timestamp
  	} else {
  		exp += time.Now().UnixNano()
  	}
  	cMsg := &cachedMsg{
  		expiration: exp,
  		msg:        msg,
  	}
  	if c.tail == nil {
  		c.head = cMsg
  	} else {
  		c.tail.next = cMsg
  		// Ensure last expiration is at least >= previous one.
  		if cMsg.expiration < c.tail.expiration {
  			cMsg.expiration = c.tail.expiration
  		}
  	}
  	cMsg.prev = c.tail
  	c.tail = cMsg
  	c.seqMaps[seq] = cMsg
  	if len(c.seqMaps) == 1 {
  		atomic.StoreInt32(&c.tryEvict, 1)
  	}
  }
docs: // add adds a message to the cache.
  // Store write lock is assumed held on entry