multi: rename fundingLockedMsg to channelReadyMsg

This commit is created by running,
```shell
gofmt -d -w -r 'fundingLockedMsg -> channelReadyMsg' .
```
This commit is contained in:
yyforyongyu committed 2023-03-17 18:21:59 +08:00
1 parent 112dc1faca
commit 539cae1999
3 files changed
+15 -15

No files matched your search

+9 -9
View File
@@ -2909,7 +2909,7 @@ func (f *Manager) sendChannelReady(completeChan *channeldb.OpenChannel,
if err != nil { if err != nil {
return fmt.Errorf("unable to create next revocation: %v", err) return fmt.Errorf("unable to create next revocation: %v", err)
} }
fundingLockedMsg := lnwire.NewChannelReady(chanID, nextRevocation) channelReadyMsg := lnwire.NewChannelReady(chanID, nextRevocation)
// If the channel negotiated the option-scid-alias feature bit, we'll // If the channel negotiated the option-scid-alias feature bit, we'll
// send a TLV segment that includes an alias the peer can use in their // send a TLV segment that includes an alias the peer can use in their
@@ -2926,7 +2926,7 @@ func (f *Manager) sendChannelReady(completeChan *channeldb.OpenChannel,
// We can use a pointer to aliases since GetAliases returns a // We can use a pointer to aliases since GetAliases returns a
// copy of the alias slice. // copy of the alias slice.
fundingLockedMsg.AliasScid = &aliases[0] channelReadyMsg.AliasScid = &aliases[0]
} }
// If the peer has disconnected before we reach this point, we will need // If the peer has disconnected before we reach this point, we will need
@@ -2956,7 +2956,7 @@ func (f *Manager) sendChannelReady(completeChan *channeldb.OpenChannel,
// We could also refresh the channel state instead of checking // We could also refresh the channel state instead of checking
// whether the feature was negotiated, but this saves us a // whether the feature was negotiated, but this saves us a
// database read. // database read.
if fundingLockedMsg.AliasScid == nil && localAlias && if channelReadyMsg.AliasScid == nil && localAlias &&
remoteAlias { remoteAlias {
// If an alias was not assigned above and the scid // If an alias was not assigned above and the scid
@@ -2983,16 +2983,16 @@ func (f *Manager) sendChannelReady(completeChan *channeldb.OpenChannel,
return err return err
} }
fundingLockedMsg.AliasScid = &alias channelReadyMsg.AliasScid = &alias
} else { } else {
fundingLockedMsg.AliasScid = &aliases[0] channelReadyMsg.AliasScid = &aliases[0]
} }
} }
log.Infof("Peer(%x) is online, sending FundingLocked "+ log.Infof("Peer(%x) is online, sending FundingLocked "+
"for ChannelID(%v)", peerKey, chanID) "for ChannelID(%v)", peerKey, chanID)
if err := peer.SendMessage(true, fundingLockedMsg); err == nil { if err := peer.SendMessage(true, channelReadyMsg); err == nil {
// Sending succeeded, we can break out and continue the // Sending succeeded, we can break out and continue the
// funding flow. // funding flow.
break break
@@ -3517,12 +3517,12 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer,
return return
} }
fundingLockedMsg := lnwire.NewChannelReady( channelReadyMsg := lnwire.NewChannelReady(
chanID, secondPoint, chanID, secondPoint,
) )
fundingLockedMsg.AliasScid = &alias channelReadyMsg.AliasScid = &alias
err = peer.SendMessage(true, fundingLockedMsg) err = peer.SendMessage(true, channelReadyMsg)
if err != nil { if err != nil {
log.Errorf("unable to send funding locked: %v", log.Errorf("unable to send funding locked: %v",
err) err)
+3 -3
View File
@@ -734,7 +734,7 @@ func (l *channelLink) syncChanStates() error {
"revocation: %v", err) "revocation: %v", err)
} }
fundingLockedMsg := lnwire.NewChannelReady( channelReadyMsg := lnwire.NewChannelReady(
l.ChanID(), nextRevocation, l.ChanID(), nextRevocation,
) )
@@ -756,10 +756,10 @@ func (l *channelLink) syncChanStates() error {
// getAliases returns a copy of the alias slice // getAliases returns a copy of the alias slice
// so it is ok to use a pointer to the first // so it is ok to use a pointer to the first
// entry. // entry.
fundingLockedMsg.AliasScid = &aliases[0] channelReadyMsg.AliasScid = &aliases[0]
} }
err = l.cfg.Peer.SendMessage(false, fundingLockedMsg) err = l.cfg.Peer.SendMessage(false, channelReadyMsg)
if err != nil { if err != nil {
return fmt.Errorf("unable to re-send "+ return fmt.Errorf("unable to re-send "+
"FundingLocked: %v", err) "FundingLocked: %v", err)
+3 -3
View File
@@ -746,12 +746,12 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
return nil, err return nil, err
} }
fundingLockedMsg := lnwire.NewChannelReady( channelReadyMsg := lnwire.NewChannelReady(
chanID, second, chanID, second,
) )
fundingLockedMsg.AliasScid = &aliasScid channelReadyMsg.AliasScid = &aliasScid
msgs = append(msgs, fundingLockedMsg) msgs = append(msgs, channelReadyMsg)
} }
// If we've negotiated the option-scid-alias feature // If we've negotiated the option-scid-alias feature