From 8119dc7a88ce5ea8dfcc135a25ccc7badc18e763 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Wed, 13 May 2020 16:22:15 +0200 Subject: [PATCH] htlcswitch: rename to getLocalLink Align function name with the contained logic. --- htlcswitch/switch.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index 57c3be67..fd62504d 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -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 @@ -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()