@@ -629,11 +629,11 @@ const (
629629 // but we still haven't announced the channel to the network.
630630 channelReadySent
631631
632- // addedToRouterGraph is the opening state of a channel if the
633- // channel has been successfully added to the router graph
634- // immediately after the channelReady message has been sent, but
635- // we still haven't announced the channel to the network.
636- addedToRouterGraph
632+ // addedToGraph is the opening state of a channel if the channel has
633+ // been successfully added to the graph immediately after the
634+ // channelReady message has been sent, but we still haven't announced
635+ // the channel to the network.
636+ addedToGraph
637637)
638638
639639func (c channelOpeningState ) String () string {
@@ -642,8 +642,8 @@ func (c channelOpeningState) String() string {
642642 return "markedOpen"
643643 case channelReadySent :
644644 return "channelReadySent"
645- case addedToRouterGraph :
646- return "addedToRouterGraph "
645+ case addedToGraph :
646+ return "addedToGraph "
647647 default :
648648 return "unknown"
649649 }
@@ -1039,9 +1039,9 @@ func (f *Manager) reservationCoordinator() {
10391039// advanceFundingState will advance the channel through the steps after the
10401040// funding transaction is broadcasted, up until the point where the channel is
10411041// ready for operation. This includes waiting for the funding transaction to
1042- // confirm, sending channel_ready to the peer, adding the channel to the
1043- // router graph, and announcing the channel. The updateChan can be set non-nil
1044- // to get OpenStatusUpdates.
1042+ // confirm, sending channel_ready to the peer, adding the channel to the graph,
1043+ // and announcing the channel. The updateChan can be set non-nil to get
1044+ // OpenStatusUpdates.
10451045//
10461046// NOTE: This MUST be run as a goroutine.
10471047func (f * Manager ) advanceFundingState (channel * channeldb.OpenChannel ,
@@ -1152,7 +1152,7 @@ func (f *Manager) stateStep(channel *channeldb.OpenChannel,
11521152 return nil
11531153
11541154 // channelReady was sent to peer, but the channel was not added to the
1155- // router graph and the channel announcement was not sent.
1155+ // graph and the channel announcement was not sent.
11561156 case channelReadySent :
11571157 // We must wait until we've received the peer's channel_ready
11581158 // before sending a channel_update according to BOLT#07.
@@ -1183,7 +1183,7 @@ func (f *Manager) stateStep(channel *channeldb.OpenChannel,
11831183
11841184 // The channel was added to the Router's topology, but the channel
11851185 // announcement was not sent.
1186- case addedToRouterGraph :
1186+ case addedToGraph :
11871187 if channel .IsZeroConf () {
11881188 // If this is a zero-conf channel, then we will wait
11891189 // for it to be confirmed before announcing it to the
@@ -3377,15 +3377,15 @@ func (f *Manager) extractAnnounceParams(c *channeldb.OpenChannel) (
33773377 return fwdMinHTLC , fwdMaxHTLC
33783378}
33793379
3380- // addToRouterGraph sends a ChannelAnnouncement and a ChannelUpdate to the
3381- // gossiper so that the channel is added to the Router 's internal graph.
3380+ // addToGraph sends a ChannelAnnouncement and a ChannelUpdate to the
3381+ // gossiper so that the channel is added to the graph builder 's internal graph.
33823382// These announcement messages are NOT broadcasted to the greater network,
33833383// only to the channel counter party. The proofs required to announce the
33843384// channel to the greater network will be created and sent in annAfterSixConfs.
33853385// The peerAlias is used for zero-conf channels to give the counter-party a
33863386// ChannelUpdate they understand. ourPolicy may be set for various
33873387// option-scid-alias channels to re-use the same policy.
3388- func (f * Manager ) addToRouterGraph (completeChan * channeldb.OpenChannel ,
3388+ func (f * Manager ) addToGraph (completeChan * channeldb.OpenChannel ,
33893389 shortChanID * lnwire.ShortChannelID ,
33903390 peerAlias * lnwire.ShortChannelID ,
33913391 ourPolicy * models.ChannelEdgePolicy ) error {
@@ -3454,8 +3454,8 @@ func (f *Manager) addToRouterGraph(completeChan *channeldb.OpenChannel,
34543454
34553455// annAfterSixConfs broadcasts the necessary channel announcement messages to
34563456// the network after 6 confs. Should be called after the channelReady message
3457- // is sent and the channel is added to the router graph (channelState is
3458- // 'addedToRouterGraph ') and the channel is ready to be used. This is the last
3457+ // is sent and the channel is added to the graph (channelState is
3458+ // 'addedToGraph ') and the channel is ready to be used. This is the last
34593459// step in the channel opening process, and the opening state will be deleted
34603460// from the database if successful.
34613461func (f * Manager ) annAfterSixConfs (completeChan * channeldb.OpenChannel ,
@@ -3566,7 +3566,7 @@ func (f *Manager) annAfterSixConfs(completeChan *channeldb.OpenChannel,
35663566 }
35673567
35683568 // We'll delete the edge and add it again via
3569- // addToRouterGraph . This is because the peer may have
3569+ // addToGraph . This is because the peer may have
35703570 // sent us a ChannelUpdate with an alias and we don't
35713571 // want to relay this.
35723572 ourPolicy , err := f .cfg .DeleteAliasEdge (baseScid )
@@ -3576,12 +3576,12 @@ func (f *Manager) annAfterSixConfs(completeChan *channeldb.OpenChannel,
35763576 err )
35773577 }
35783578
3579- err = f .addToRouterGraph (
3579+ err = f .addToGraph (
35803580 completeChan , & baseScid , nil , ourPolicy ,
35813581 )
35823582 if err != nil {
35833583 return fmt .Errorf ("failed to re-add to " +
3584- "router graph: %v" , err )
3584+ "graph: %v" , err )
35853585 }
35863586 }
35873587
@@ -3605,9 +3605,9 @@ func (f *Manager) annAfterSixConfs(completeChan *channeldb.OpenChannel,
36053605 return nil
36063606}
36073607
3608- // waitForZeroConfChannel is called when the state is addedToRouterGraph with
3608+ // waitForZeroConfChannel is called when the state is addedToGraph with
36093609// a zero-conf channel. This will wait for the real confirmation, add the
3610- // confirmed SCID to the router graph, and then announce after six confs.
3610+ // confirmed SCID to the graph, and then announce after six confs.
36113611func (f * Manager ) waitForZeroConfChannel (c * channeldb.OpenChannel ) error {
36123612 // First we'll check whether the channel is confirmed on-chain. If it
36133613 // is already confirmed, the chainntnfs subsystem will return with the
@@ -3662,15 +3662,15 @@ func (f *Manager) waitForZeroConfChannel(c *channeldb.OpenChannel) error {
36623662 }
36633663
36643664 // We'll need to update the graph with the new ShortChannelID
3665- // via an addToRouterGraph call. We don't pass in the peer's
3665+ // via an addToGraph call. We don't pass in the peer's
36663666 // alias since we'll be using the confirmed SCID from now on
36673667 // regardless if it's public or not.
3668- err = f .addToRouterGraph (
3668+ err = f .addToGraph (
36693669 c , & confChan .shortChanID , nil , ourPolicy ,
36703670 )
36713671 if err != nil {
36723672 return fmt .Errorf ("failed adding confirmed zero-conf " +
3673- "SCID to router graph: %v" , err )
3673+ "SCID to graph: %v" , err )
36743674 }
36753675 }
36763676
@@ -3972,7 +3972,7 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
39723972// handleChannelReadyReceived is called once the remote's channelReady message
39733973// is received and processed. At this stage, we must have sent out our
39743974// channelReady message, once the remote's channelReady is processed, the
3975- // channel is now active, thus we change its state to `addedToRouterGraph ` to
3975+ // channel is now active, thus we change its state to `addedToGraph ` to
39763976// let the channel start handling routing.
39773977func (f * Manager ) handleChannelReadyReceived (channel * channeldb.OpenChannel ,
39783978 scid * lnwire.ShortChannelID , pendingChanID [32 ]byte ,
@@ -4004,25 +4004,25 @@ func (f *Manager) handleChannelReadyReceived(channel *channeldb.OpenChannel,
40044004 peerAlias = & foundAlias
40054005 }
40064006
4007- err := f .addToRouterGraph (channel , scid , peerAlias , nil )
4007+ err := f .addToGraph (channel , scid , peerAlias , nil )
40084008 if err != nil {
4009- return fmt .Errorf ("failed adding to router graph: %w" , err )
4009+ return fmt .Errorf ("failed adding to graph: %w" , err )
40104010 }
40114011
40124012 // As the channel is now added to the ChannelRouter's topology, the
40134013 // channel is moved to the next state of the state machine. It will be
40144014 // moved to the last state (actually deleted from the database) after
40154015 // the channel is finally announced.
40164016 err = f .saveChannelOpeningState (
4017- & channel .FundingOutpoint , addedToRouterGraph , scid ,
4017+ & channel .FundingOutpoint , addedToGraph , scid ,
40184018 )
40194019 if err != nil {
40204020 return fmt .Errorf ("error setting channel state to" +
4021- " addedToRouterGraph : %w" , err )
4021+ " addedToGraph : %w" , err )
40224022 }
40234023
40244024 log .Debugf ("Channel(%v) with ShortChanID %v: successfully " +
4025- "added to router graph" , chanID , scid )
4025+ "added to graph" , chanID , scid )
40264026
40274027 // Give the caller a final update notifying them that the channel is
40284028 fundingPoint := channel .FundingOutpoint
@@ -4347,7 +4347,7 @@ func (f *Manager) announceChannel(localIDKey, remoteIDKey *btcec.PublicKey,
43474347 }
43484348
43494349 // We only send the channel proof announcement and the node announcement
4350- // because addToRouterGraph previously sent the ChannelAnnouncement and
4350+ // because addToGraph previously sent the ChannelAnnouncement and
43514351 // the ChannelUpdate announcement messages. The channel proof and node
43524352 // announcements are broadcast to the greater network.
43534353 errChan := f .cfg .SendAnnouncement (ann .chanProof )
0 commit comments