@@ -116,6 +116,19 @@ var AddInvoiceCommand = cli.Command{
116
116
"use on a blinded path. The flag may be " +
117
117
"specified multiple times." ,
118
118
},
119
+ cli.StringSliceFlag {
120
+ Name : "blinded_path_income_node" ,
121
+ Usage : "The pub key (in hex) of a node to be " +
122
+ "used in a blinded path as the income " +
123
+ "node. The flag may be specified multiple " +
124
+ "times." ,
125
+ },
126
+ cli.StringSliceFlag {
127
+ Name : "blinded_path_income_channel" ,
128
+ Usage : "The channel id to be used in a blinded path " +
129
+ "as the income channel. The flag may be " +
130
+ "specified multiple times." ,
131
+ },
119
132
},
120
133
Action : actionDecorator (addInvoice ),
121
134
}
@@ -202,7 +215,9 @@ func parseBlindedPathCfg(ctx *cli.Context) (*lnrpc.BlindedPathConfig, error) {
202
215
if ctx .IsSet ("min_real_blinded_hops" ) ||
203
216
ctx .IsSet ("num_blinded_hops" ) ||
204
217
ctx .IsSet ("max_blinded_paths" ) ||
205
- ctx .IsSet ("blinded_path_omit_node" ) {
218
+ ctx .IsSet ("blinded_path_omit_node" ) ||
219
+ ctx .IsSet ("blinded_path_income_node" ) ||
220
+ ctx .IsSet ("blinded_path_income_channel" ) {
206
221
207
222
return nil , fmt .Errorf ("blinded path options are " +
208
223
"only used if the `--blind` options is set" )
@@ -211,6 +226,16 @@ func parseBlindedPathCfg(ctx *cli.Context) (*lnrpc.BlindedPathConfig, error) {
211
226
return nil , nil
212
227
}
213
228
229
+ if ctx .IsSet ("blinded_path_income_channel" ) {
230
+ if ctx .IsSet ("blinded_path_income_node" ) {
231
+
232
+ return nil , fmt .Errorf ("`--blinded_path_income_node`" +
233
+ "is used only if the " +
234
+ "`--blinded_path_income_channel` is not" )
235
+
236
+ }
237
+ }
238
+
214
239
var blindCfg lnrpc.BlindedPathConfig
215
240
216
241
if ctx .IsSet ("min_real_blinded_hops" ) {
@@ -239,6 +264,27 @@ func parseBlindedPathCfg(ctx *cli.Context) (*lnrpc.BlindedPathConfig, error) {
239
264
)
240
265
}
241
266
267
+ for _ , pK := range ctx .StringSlice ("blinded_path_income_node" ) {
268
+ pKBytes , err := hex .DecodeString (pK )
269
+ if err != nil {
270
+ return nil , err
271
+ }
272
+
273
+ blindCfg .NodeIncomeList = append (
274
+ blindCfg .NodeIncomeList , pKBytes ,
275
+ )
276
+ }
277
+
278
+ for _ , chanId := range ctx .StringSlice ("blinded_path_income_channel" ) {
279
+ channelId , err := strconv .ParseUint (chanId , 10 , 64 )
280
+ if err != nil {
281
+ panic (err ) // Handle this better in production code
282
+ }
283
+ blindCfg .ChannelIncomeList = append (
284
+ blindCfg .ChannelIncomeList , channelId ,
285
+ )
286
+ }
287
+
242
288
return & blindCfg , nil
243
289
}
244
290
0 commit comments