Skip to content

Commit fdff391

Browse files
committed
routing: add the option to set the income node or channel on blinded path
1 parent 31f2bac commit fdff391

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

routing/router.go

+13-3
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,14 @@ type BlindedPathRestrictions struct {
612612
// NodeOmissionSet is a set of nodes that should not be used within any
613613
// of the blinded paths that we generate.
614614
NodeOmissionSet fn.Set[route.Vertex]
615+
616+
// NodeIncomeSet holds a set of node IDs of nodes that we should
617+
// use as income hope during blinded path selection.
618+
NodeIncomeSet fn.Set[route.Vertex]
619+
620+
// ChannelIncomeSet holds a set of channel IDs of channels that we
621+
// should use as income channel during blinded path selection.
622+
ChannelIncomeSet fn.Set[uint64]
615623
}
616624

617625
// FindBlindedPaths finds a selection of paths to the destination node that can
@@ -624,9 +632,11 @@ func (r *ChannelRouter) FindBlindedPaths(destination route.Vertex,
624632
// path length restrictions.
625633
paths, err := findBlindedPaths(
626634
r.cfg.RoutingGraph, destination, &blindedPathRestrictions{
627-
minNumHops: restrictions.MinDistanceFromIntroNode,
628-
maxNumHops: restrictions.NumHops,
629-
nodeOmissionSet: restrictions.NodeOmissionSet,
635+
minNumHops: restrictions.MinDistanceFromIntroNode,
636+
maxNumHops: restrictions.NumHops,
637+
nodeOmissionSet: restrictions.NodeOmissionSet,
638+
nodeIncomeSet: restrictions.NodeIncomeSet,
639+
channelIncomeSet: restrictions.ChannelIncomeSet,
630640
},
631641
)
632642
if err != nil {

0 commit comments

Comments
 (0)