@@ -30,30 +30,29 @@ var (
3030
3131// isPublicNode checks if a node is public, by simply checking if there's any
3232// channels reported to the node.
33- func isPublicNode (ctx context.Context , lnd * lndclient.LndServices ,
33+ func isPublicNode (ctx context.Context , lndClient lndclient.LightningClient ,
3434 pubKey [33 ]byte ) (bool , error ) {
3535
3636 // GetNodeInfo doesn't report our private channels with the queried node
37- // so we can use it to determine if the node is considered public.
38- nodeInfo , err := lnd .Client .GetNodeInfo (
39- ctx , pubKey , true ,
40- )
37+ // so, we can use it to determine if the node is considered public.
38+ nodeInfo , err := lndClient .GetNodeInfo (ctx , pubKey , true )
4139
4240 if err != nil {
4341 return false , err
4442 }
4543
46- return ( nodeInfo .ChannelCount > 0 ) , nil
44+ return nodeInfo .ChannelCount > 0 , nil
4745}
4846
4947// fetchChannelEdgesByID fetches the edge info for the passed channel and
5048// returns the channeldb structs filled with the data that is needed for
5149// LND's SelectHopHints implementation.
52- func fetchChannelEdgesByID (ctx context.Context , lnd * lndclient.LndServices ,
53- chanID uint64 ) (* models.ChannelEdgeInfo , * models.ChannelEdgePolicy ,
50+ func fetchChannelEdgesByID (ctx context.Context ,
51+ lndClient lndclient.LightningClient , chanID uint64 ) (
52+ * models.ChannelEdgeInfo , * models.ChannelEdgePolicy ,
5453 * models.ChannelEdgePolicy , error ) {
5554
56- chanInfo , err := lnd . Client .GetChanInfo (ctx , chanID )
55+ chanInfo , err := lndClient .GetChanInfo (ctx , chanID )
5756 if err != nil {
5857 return nil , nil , nil , err
5958 }
@@ -125,14 +124,14 @@ func getAlias(aliasCache map[lnwire.ChannelID]lnwire.ShortChannelID,
125124
126125// SelectHopHints calls into LND's exposed SelectHopHints prefiltered to the
127126// includeNodes map (unless it's empty).
128- func SelectHopHints (ctx context.Context , lnd * lndclient.LndServices ,
127+ func SelectHopHints (ctx context.Context , lndClient lndclient.LightningClient ,
129128 amt btcutil.Amount , numMaxHophints int ,
130129 includeNodes map [route.Vertex ]struct {}) ([][]zpay32.HopHint , error ) {
131130
132131 aliasCache := make (map [lnwire.ChannelID ]lnwire.ShortChannelID )
133132
134133 // Fetch all active and public channels.
135- channels , err := lnd . Client .ListChannels (ctx , false , false )
134+ channels , err := lndClient .ListChannels (ctx , false , false )
136135 if err != nil {
137136 return nil , err
138137 }
@@ -175,13 +174,13 @@ func SelectHopHints(ctx context.Context, lnd *lndclient.LndServices,
175174
176175 cfg := & SelectHopHintsCfg {
177176 IsPublicNode : func (pubKey [33 ]byte ) (bool , error ) {
178- return isPublicNode (ctx , lnd , pubKey )
177+ return isPublicNode (ctx , lndClient , pubKey )
179178 },
180179 FetchChannelEdgesByID : func (chanID uint64 ) (
181180 * models.ChannelEdgeInfo , * models.ChannelEdgePolicy ,
182181 * models.ChannelEdgePolicy , error ) {
183182
184- return fetchChannelEdgesByID (ctx , lnd , chanID )
183+ return fetchChannelEdgesByID (ctx , lndClient , chanID )
185184 },
186185 GetAlias : func (id lnwire.ChannelID ) (
187186 lnwire.ShortChannelID , error ) {
0 commit comments