Skip to content

Commit

Permalink
htlcswitch: rename to getLocalLink
Browse files Browse the repository at this point in the history
Align function name with the contained logic.
  • Loading branch information
joostjager committed May 20, 2020
1 parent e00840e commit 8119dc7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions htlcswitch/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ func (s *Switch) SendHTLC(firstHop lnwire.ShortChannelID, paymentID uint64,

// User has created the htlc update therefore we should find the
// appropriate channel link and send the payment over this link.
link, linkErr := s.handleLocalAddHTLC(packet, htlc)
link, linkErr := s.getLocalLink(packet, htlc)
if linkErr != nil {
// Notify the htlc notifier of a link failure on our
// outgoing link. Incoming timelock/amount values are
Expand Down Expand Up @@ -750,12 +750,11 @@ func (s *Switch) routeAsync(packet *htlcPacket, errChan chan error,
}
}

// handleLocalAddHTLC handles the addition of a htlc for a send that
// originates from our node. It returns the link that the htlc should
// be forwarded outwards on, and a link error if the htlc cannot be
// forwarded.
func (s *Switch) handleLocalAddHTLC(pkt *htlcPacket,
htlc *lnwire.UpdateAddHTLC) (ChannelLink, *LinkError) {
// getLocalLink handles the addition of a htlc for a send that originates from
// our node. It returns the link that the htlc should be forwarded outwards on,
// and a link error if the htlc cannot be forwarded.
func (s *Switch) getLocalLink(pkt *htlcPacket, htlc *lnwire.UpdateAddHTLC) (
ChannelLink, *LinkError) {

// Try to find links by node destination.
s.indexMtx.RLock()
Expand Down

0 comments on commit 8119dc7

Please sign in to comment.