code: func (s *StanServer) processRecoveredChannels(channels map[string]*stores.RecoveredChannel) ([]*subState, error) {
  	allSubs := make([]*subState, 0, 16)
  
  	for channelName, recoveredChannel := range channels {
  		channel, err := s.channels.create(s, channelName, recoveredChannel.Channel)
  		if err != nil {
  			return nil, err
  		}
  		if !s.isClustered {
  			// Get the recovered subscriptions for this channel.
  			for _, recSub := range recoveredChannel.Subscriptions {
  				sub := s.recoverOneSub(channel, recSub.Sub, recSub.Pending, nil)
  				if sub != nil {
  					// Subscribe to subscription ACKs
  					if err := sub.startAckSub(s.nca, s.processAckMsg); err != nil {
  						return nil, err
  					}
  					allSubs = append(allSubs, sub)
  				}
  			}
  			// Now that we have recovered possible subscriptions for this channel,
  			// check if we should start the delete timer.
  			if channel.activity != nil {
  				s.channels.maybeStartChannelDeleteTimer(channelName, channel)
  			}
  		}
  	}
  	return allSubs, nil
  }
docs: // Reconstruct the subscription state on restart.