Skip to content

Commit 7a604c8

Browse files
committed
rpcserver: validate blindCfg.MaxNumPaths
Assert that the blindCfg.MaxNumPaths value is non-zero.
1 parent 770d1d9 commit 7a604c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rpcserver.go

Lines changed: 4 additions & 0 deletions
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)