htlcswitch: rename to getLocalLink
Align function name with the contained logic.
This commit is contained in:
parent
e00840e2ab
commit
8119dc7a88
@ -476,7 +476,7 @@ func (s *Switch) SendHTLC(firstHop lnwire.ShortChannelID, paymentID uint64,
|
|||||||
|
|
||||||
// User has created the htlc update therefore we should find the
|
// User has created the htlc update therefore we should find the
|
||||||
// appropriate channel link and send the payment over this link.
|
// 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 {
|
if linkErr != nil {
|
||||||
// Notify the htlc notifier of a link failure on our
|
// Notify the htlc notifier of a link failure on our
|
||||||
// outgoing link. Incoming timelock/amount values are
|
// 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
|
// getLocalLink handles the addition of a htlc for a send that originates from
|
||||||
// originates from our node. It returns the link that the htlc should
|
// our node. It returns the link that the htlc should be forwarded outwards on,
|
||||||
// be forwarded outwards on, and a link error if the htlc cannot be
|
// and a link error if the htlc cannot be forwarded.
|
||||||
// forwarded.
|
func (s *Switch) getLocalLink(pkt *htlcPacket, htlc *lnwire.UpdateAddHTLC) (
|
||||||
func (s *Switch) handleLocalAddHTLC(pkt *htlcPacket,
|
ChannelLink, *LinkError) {
|
||||||
htlc *lnwire.UpdateAddHTLC) (ChannelLink, *LinkError) {
|
|
||||||
|
|
||||||
// Try to find links by node destination.
|
// Try to find links by node destination.
|
||||||
s.indexMtx.RLock()
|
s.indexMtx.RLock()
|
||||||
|
Loading…
Reference in New Issue
Block a user