mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 18:03:14 +02:00
multi: add node omission list for blinded paths
This commit is contained in:
@@ -110,6 +110,12 @@ var addInvoiceCommand = cli.Command{
|
||||
"to an invoice. This option will only be " +
|
||||
"used if `--blind` has also been set.",
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "blinded_path_omit_node",
|
||||
Usage: "The pub key (in hex) of a node not to " +
|
||||
"use on a blinded path. The flag may be " +
|
||||
"specified multiple times.",
|
||||
},
|
||||
},
|
||||
Action: actionDecorator(addInvoice),
|
||||
}
|
||||
@@ -221,6 +227,17 @@ func parseBlindedPathCfg(ctx *cli.Context) (*lnrpc.BlindedPathConfig, error) {
|
||||
blindCfg.MaxNumPaths = &maxPaths
|
||||
}
|
||||
|
||||
for _, pubKey := range ctx.StringSlice("blinded_path_omit_node") {
|
||||
pubKeyBytes, err := hex.DecodeString(pubKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
blindCfg.NodeOmissionList = append(
|
||||
blindCfg.NodeOmissionList, pubKeyBytes,
|
||||
)
|
||||
}
|
||||
|
||||
return &blindCfg, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user