// NewRcChannels returns a new RcChannels
435124
func NewRcChannels(TIME_BOOT_MS uint32, CHAN1_RAW uint16, CHAN2_RAW uint16, CHAN3_RAW uint16, CHAN4_RAW uint16, CHAN5_RAW uint16, CHAN6_RAW uint16, CHAN7_RAW uint16, CHAN8_RAW uint16, CHAN9_RAW uint16, CHAN10_RAW uint16, CHAN11_RAW uint16, CHAN12_RAW uint16, CHAN13_RAW uint16, CHAN14_RAW uint16, CHAN15_RAW uint16, CHAN16_RAW uint16, CHAN17_RAW uint16, CHAN18_RAW uint16, CHANCOUNT uint8, RSSI uint8) *RcChannels {
	m := RcChannels{}
	m.TIME_BOOT_MS = TIME_BOOT_MS
	m.CHAN1_RAW = CHAN1_RAW
	m.CHAN2_RAW = CHAN2_RAW
	m.CHAN3_RAW = CHAN3_RAW
	m.CHAN4_RAW = CHAN4_RAW
	m.CHAN5_RAW = CHAN5_RAW
	m.CHAN6_RAW = CHAN6_RAW
	m.CHAN7_RAW = CHAN7_RAW
	m.CHAN8_RAW = CHAN8_RAW
	m.CHAN9_RAW = CHAN9_RAW
	m.CHAN10_RAW = CHAN10_RAW
	m.CHAN11_RAW = CHAN11_RAW
	m.CHAN12_RAW = CHAN12_RAW
	m.CHAN13_RAW = CHAN13_RAW
	m.CHAN14_RAW = CHAN14_RAW
	m.CHAN15_RAW = CHAN15_RAW
	m.CHAN16_RAW = CHAN16_RAW
	m.CHAN17_RAW = CHAN17_RAW
	m.CHAN18_RAW = CHAN18_RAW
	m.CHANCOUNT = CHANCOUNT
	m.RSSI = RSSI
	return &m
}
624078
func NewReceiver(topic, channel, lookupdAddr string, cfg *nsq.Config) (*Receiver, error) {
	cons, err := nsq.NewConsumer(topic, channel, cfg)
	if err != nil {
		return nil, err
	}

	return &Receiver{
		lookupdAddr: lookupdAddr,
		cons:        cons,
	}, nil
}
246415
func NewChannelHandler(channel LogPartsChannel) *ChannelHandler {
	handler := new(ChannelHandler)
	handler.SetChannel(channel)

	return handler
}
1184549
func (s *Mp2Settings) SetChannels(v int64) *Mp2Settings {
	s.Channels = &v
	return s
}
414459
func (c channelState) Channels() []Channel {
	chans := make([]Channel, 0, len(c))
	for _, channel := range c {
		chans = append(chans, channel)
	}
	return chans
}
717113
func NewRefCache(opts ...options.Opt) *lazycache.Cache {
	initializer := func(key lazycache.Key) (interface{}, error) {
		ck, ok := key.(CacheKey)
		if !ok {
			return nil, errors.New("unexpected cache key")
		}
		return NewRef(ck.Context(), ck.Provider(), ck.ChannelID(), opts...), nil
	}

	return lazycache.New("Channel_Cfg_Cache", initializer)
}
28169
func NewMockChannel(channelID string) (*Channel, error) {

	ctx := &mockClientContext{
		Providers:       NewMockProviderContext(),
		SigningIdentity: mspmocks.NewMockSigningIdentity("user", "Org1MSP"),
	}

	// Set up mock channel service
	chProvider, err := NewMockChannelProvider(ctx)
	if err != nil {
		return nil, errors.WithMessage(err, "new mock channel provider failed")
	}
	channelService, err := chProvider.ChannelService(ctx, channelID)
	if err != nil {
		return nil, errors.WithMessage(err, "failed to create mock channel service")
	}

	peer := NewMockPeer("Peer1", "example.com")

	channelService.(*MockChannelService).SetDiscovery(NewMockDiscoveryService(nil, peer))
	channelService.(*MockChannelService).SetSelection(NewMockSelectionService(nil, peer))

	channel := &Channel{
		Client:         ctx,
		channelService: channelService,
		channelID:      channelID,
	}

	return channel, nil
}
551132
func RegisterRCS(id RCSBackend, name string, loader RCSLoader) {
	rcsRegistry[id] = loader
	rcsNameToBackendMap[name] = id
	rcsBackendToNameMap[id] = name
}
306019
func NewChannelEndpoints() (DriverEndpoint, EngineEndpoint) {
	channel := make(chan chan message)

	return NewChannelDriverEndpoint(channel), NewChannelEngineEndpoint(channel)
}
1135918
func NewChannelLink(cfg ChannelLinkConfig,
	channel *lnwallet.LightningChannel) ChannelLink {

	return &channelLink{
		cfg:         cfg,
		channel:     channel,
		shortChanID: channel.ShortChanID(),
		// TODO(roasbeef): just do reserve here?
		logCommitTimer: time.NewTimer(300 * time.Millisecond),
		overflowQueue:  newPacketQueue(input.MaxHTLCNumber / 2),
		htlcUpdates:    make(chan []channeldb.HTLC),
		hodlMap:        make(map[lntypes.Hash][]hodlHtlc),
		hodlQueue:      queue.NewConcurrentQueue(10),
		quit:           make(chan struct{}),
	}
}
255668
func NewRSEncoder(f *Field, c int) *RSEncoder {
	gen, lgen := f.gen(c)
	return &RSEncoder{f: f, c: c, gen: gen, lgen: lgen}
}
1050014
func NewRwSet(ccID string) *rwsetutil.NsRwSet {
	return &rwsetutil.NsRwSet{
		NameSpace:        ccID,
		KvRwSet:          &kvrwset.KVRWSet{},
		CollHashedRwSets: nil,
	}
}
119437
func New(rp ringpop.Interface, f ClientFactory, ch *tchannel.Channel) Router {
	r := &router{
		ringpop: rp,
		factory: f,
		channel: ch,

		clientCache: make(map[string]cacheEntry),
	}
	rp.AddListener(r)
	return r
}
743421
func createRPCClosedChannel(
	dbChannel *channeldb.ChannelCloseSummary) *lnrpc.ChannelCloseSummary {

	nodePub := dbChannel.RemotePub
	nodeID := hex.EncodeToString(nodePub.SerializeCompressed())

	var closeType lnrpc.ChannelCloseSummary_ClosureType
	switch dbChannel.CloseType {
	case channeldb.CooperativeClose:
		closeType = lnrpc.ChannelCloseSummary_COOPERATIVE_CLOSE
	case channeldb.LocalForceClose:
		closeType = lnrpc.ChannelCloseSummary_LOCAL_FORCE_CLOSE
	case channeldb.RemoteForceClose:
		closeType = lnrpc.ChannelCloseSummary_REMOTE_FORCE_CLOSE
	case channeldb.BreachClose:
		closeType = lnrpc.ChannelCloseSummary_BREACH_CLOSE
	case channeldb.FundingCanceled:
		closeType = lnrpc.ChannelCloseSummary_FUNDING_CANCELED
	case channeldb.Abandoned:
		closeType = lnrpc.ChannelCloseSummary_ABANDONED
	}

	return &lnrpc.ChannelCloseSummary{
		Capacity:          int64(dbChannel.Capacity),
		RemotePubkey:      nodeID,
		CloseHeight:       dbChannel.CloseHeight,
		CloseType:         closeType,
		ChannelPoint:      dbChannel.ChanPoint.String(),
		ChanId:            dbChannel.ShortChanID.ToUint64(),
		SettledBalance:    int64(dbChannel.SettledBalance),
		TimeLockedBalance: int64(dbChannel.TimeLockedBalance),
		ChainHash:         dbChannel.ChainHash.String(),
		ClosingTxHash:     dbChannel.ClosingTXID.String(),
	}
}
332116
func (p *PUContext) CreateRcvRules(policyRules policy.TagSelectorList) {
	p.rcv = p.createRuleDBs(policyRules)
}
206267
func (s *Filters) SetChannels(v []*string) *Filters {
	s.Channels = v
	return s
}
327495
func NewMConnection(conn net.Conn, chDescs []*ChannelDescriptor, onReceive receiveCbFunc, onError errorCbFunc) *MConnection {
	return NewMConnectionWithConfig(
		conn,
		chDescs,
		onReceive,
		onError,
		DefaultMConnConfig())
}