@@ -1165,6 +1165,14 @@ type blindedPathRestrictions struct {
1165
1165
// nodeOmissionSet holds a set of node IDs of nodes that we should
1166
1166
// ignore during blinded path selection.
1167
1167
nodeOmissionSet fn.Set [route.Vertex ]
1168
+
1169
+ // nodeIncomeSet holds a set of node IDs of nodes that we should
1170
+ // use as income hope during blinded path selection.
1171
+ nodeIncomeSet fn.Set [route.Vertex ]
1172
+
1173
+ // channelIncomeSet holds a set of channel IDs of channels that we
1174
+ // should use as income channel during blinded path selection.
1175
+ channelIncomeSet fn.Set [uint64 ]
1168
1176
}
1169
1177
1170
1178
// blindedHop holds the information about a hop we have selected for a blinded
@@ -1274,6 +1282,15 @@ func processNodeForBlindedPath(g Graph, node route.Vertex,
1274
1282
return nil , false , nil
1275
1283
}
1276
1284
1285
+ // If we have explicity been told to consider this node as the
1286
+ // income hope.
1287
+ if ! restrictions .nodeIncomeSet .IsEmpty () {
1288
+ if len (alreadyVisited ) == 1 &&
1289
+ ! restrictions .nodeIncomeSet .Contains (node ) {
1290
+ return nil , false , nil
1291
+ }
1292
+ }
1293
+
1277
1294
supports , err := supportsRouteBlinding (node )
1278
1295
if err != nil {
1279
1296
return nil , false , err
@@ -1300,6 +1317,16 @@ func processNodeForBlindedPath(g Graph, node route.Vertex,
1300
1317
// node that can be used for blinded paths
1301
1318
err = g .ForEachNodeChannel (node ,
1302
1319
func (channel * channeldb.DirectedChannel ) error {
1320
+ // If we have explicity been told to consider this
1321
+ // channel as the income hope.
1322
+ channelIncomeSet := restrictions .channelIncomeSet
1323
+ if ! channelIncomeSet .IsEmpty () {
1324
+ if len (alreadyVisited ) == 0 &&
1325
+ ! channelIncomeSet .Contains (channel .ChannelID ) {
1326
+ return nil
1327
+ }
1328
+ }
1329
+
1303
1330
// Keep track of how many incoming channels this node
1304
1331
// has. We only use a node as an introduction node if it
1305
1332
// has channels other than the one that lead us to it.
0 commit comments