multi: add node omission list for blinded paths

This commit is contained in:
Elle Mouton
2024-08-05 14:27:11 +02:00
parent b490deefdf
commit e4619afc08
10 changed files with 1254 additions and 1142 deletions

View File

@@ -5788,6 +5788,7 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
MinDistanceFromIntroNode: globalBlindCfg.MinNumRealHops,
NumHops: globalBlindCfg.NumHops,
MaxNumPaths: globalBlindCfg.MaxNumPaths,
NodeOmissionSet: fn.NewSet[route.Vertex](),
}
if blind {
@@ -5802,6 +5803,15 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
blindingRestrictions.MaxNumPaths =
uint8(*blindCfg.MaxNumPaths)
}
for _, nodeIDBytes := range blindCfg.NodeOmissionList {
vertex, err := route.NewVertexFromBytes(nodeIDBytes)
if err != nil {
return nil, err
}
blindingRestrictions.NodeOmissionSet.Add(vertex)
}
}
if blindingRestrictions.MinDistanceFromIntroNode >