routing: only set firstHopBlob if we have custom records

This commit is contained in:
Olaoluwa Osuntokun
2024-07-11 19:47:34 -07:00
parent e8bf89160d
commit 14a6f73258

View File

@@ -1007,6 +1007,8 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
continue
}
var firstHopBlob fn.Option[tlv.Blob]
if r.FirstHopCustomRecords != nil {
firstHopTLVs := lnwire.CustomRecords(
r.FirstHopCustomRecords,
)
@@ -1015,10 +1017,12 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
return nil, 0, err
}
firstHopBlob = fn.Some(firstHopData)
}
edge := edgeUnifier.getEdge(
netAmountReceived, g.bandwidthHints,
partialPath.outboundFee,
fn.Some[tlv.Blob](firstHopData),
partialPath.outboundFee, firstHopBlob,
)
if edge == nil {