mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
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:
@ -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