mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-27 20:39:56 +02:00
peer: rename newChannels
to newActiveChannel
As new pending channels will be tracked in the following commits, the `newChannels` is now renamed to `newActiveChannel` to explicitly refer to active, non-pending channels.
This commit is contained in:
@@ -423,9 +423,9 @@ type Brontide struct {
|
|||||||
// waited a shorter duration.
|
// waited a shorter duration.
|
||||||
addedChannels *lnutils.SyncMap[lnwire.ChannelID, struct{}]
|
addedChannels *lnutils.SyncMap[lnwire.ChannelID, struct{}]
|
||||||
|
|
||||||
// newChannels is used by the fundingManager to send fully opened
|
// newActiveChannel is used by the fundingManager to send fully opened
|
||||||
// channels to the source peer which handled the funding workflow.
|
// channels to the source peer which handled the funding workflow.
|
||||||
newChannels chan *newChannelMsg
|
newActiveChannel chan *newChannelMsg
|
||||||
|
|
||||||
// activeMsgStreams is a map from channel id to the channel streams that
|
// activeMsgStreams is a map from channel id to the channel streams that
|
||||||
// proxy messages to individual, active links.
|
// proxy messages to individual, active links.
|
||||||
@@ -493,7 +493,7 @@ func NewBrontide(cfg Config) *Brontide {
|
|||||||
activeChannels: &lnutils.SyncMap[
|
activeChannels: &lnutils.SyncMap[
|
||||||
lnwire.ChannelID, *lnwallet.LightningChannel,
|
lnwire.ChannelID, *lnwallet.LightningChannel,
|
||||||
]{},
|
]{},
|
||||||
newChannels: make(chan *newChannelMsg, 1),
|
newActiveChannel: make(chan *newChannelMsg, 1),
|
||||||
|
|
||||||
activeMsgStreams: make(map[lnwire.ChannelID]*msgStream),
|
activeMsgStreams: make(map[lnwire.ChannelID]*msgStream),
|
||||||
activeChanCloses: make(map[lnwire.ChannelID]*chancloser.ChanCloser),
|
activeChanCloses: make(map[lnwire.ChannelID]*chancloser.ChanCloser),
|
||||||
@@ -2392,8 +2392,8 @@ out:
|
|||||||
// A new channel has arrived which means we've just completed a
|
// A new channel has arrived which means we've just completed a
|
||||||
// funding workflow. We'll initialize the necessary local
|
// funding workflow. We'll initialize the necessary local
|
||||||
// state, and notify the htlc switch of a new link.
|
// state, and notify the htlc switch of a new link.
|
||||||
case newChanReq := <-p.newChannels:
|
case req := <-p.newActiveChannel:
|
||||||
p.handleNewActiveChannel(newChanReq)
|
p.handleNewActiveChannel(req)
|
||||||
|
|
||||||
// We've just received a local request to close an active
|
// We've just received a local request to close an active
|
||||||
// channel. It will either kick of a cooperative channel
|
// channel. It will either kick of a cooperative channel
|
||||||
@@ -3474,7 +3474,7 @@ func (p *Brontide) AddNewChannel(channel *channeldb.OpenChannel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case p.newChannels <- newChanMsg:
|
case p.newActiveChannel <- newChanMsg:
|
||||||
case <-cancel:
|
case <-cancel:
|
||||||
return errors.New("canceled adding new channel")
|
return errors.New("canceled adding new channel")
|
||||||
case <-p.quit:
|
case <-p.quit:
|
||||||
|
Reference in New Issue
Block a user