rpcserver: validate blindCfg.MaxNumPaths

Assert that the blindCfg.MaxNumPaths value is non-zero.
This commit is contained in:
MPins committed 2025-05-13 19:42:53 -03:00
1 parent 770d1d93be
commit 7a604c8d00
1 file changed
+4
+4
View File
@@ -6200,6 +6200,10 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
blindingRestrictions.NumHops = uint8(*blindCfg.NumHops)
}
if blindCfg.MaxNumPaths != nil {
if *blindCfg.MaxNumPaths == 0 {
return nil, fmt.Errorf("blinded max num " +
"paths cannot be 0")
}
blindingRestrictions.MaxNumPaths =
uint8(*blindCfg.MaxNumPaths)
}