multi: add IsBlinded to lnrpc.Invoice for nicer UX
The BlindedPathConfig struct is nice for invoice creation but when we use the Invoice message for viewing an invoice, it would be nicer to see an "is_blinded" field.
This commit is contained in:
9 files changed
+1226
-1175
No files matched your search
+7
-2
@@ -5781,7 +5781,7 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
|
||||
var (
|
||||
defaultDelta = r.cfg.Bitcoin.TimeLockDelta
|
||||
blindCfg = invoice.BlindedPathConfig
|
||||
blind = blindCfg != nil
|
||||
blind = invoice.IsBlinded
|
||||
)
|
||||
|
||||
globalBlindCfg := r.server.cfg.Routing.BlindedPaths
|
||||
@@ -5792,7 +5792,12 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
|
||||
NodeOmissionSet: fn.NewSet[route.Vertex](),
|
||||
}
|
||||
|
||||
if blind {
|
||||
if blindCfg != nil && !blind {
|
||||
return nil, fmt.Errorf("blinded path config provided but " +
|
||||
"IsBlinded not set")
|
||||
}
|
||||
|
||||
if blind && blindCfg != nil {
|
||||
if blindCfg.MinNumRealHops != nil {
|
||||
blindingRestrictions.MinDistanceFromIntroNode =
|
||||
uint8(*blindCfg.MinNumRealHops)
|
||||
|
||||
Reference in new issue
Block a user