Skip to content

Commit a5814e4

Browse files
committed
rpcserver: validate blindCfg.MaxNumPaths
Assert that the blindCfg.MaxNumPaths value is non-zero.
1 parent 843e502 commit a5814e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rpcserver.go

+4
Original file line numberDiff line numberDiff line change
@@ -6200,6 +6200,10 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
62006200
blindingRestrictions.NumHops = uint8(*blindCfg.NumHops)
62016201
}
62026202
if blindCfg.MaxNumPaths != nil {
6203+
if *blindCfg.MaxNumPaths == 0 {
6204+
return nil, fmt.Errorf("blinded max num " +
6205+
"paths cannot be 0")
6206+
}
62036207
blindingRestrictions.MaxNumPaths =
62046208
uint8(*blindCfg.MaxNumPaths)
62056209
}

0 commit comments

Comments
 (0)