From 770d1d93bea29344b674c5988e99f394da560aaf Mon Sep 17 00:00:00 2001 From: MPins Date: Wed, 23 Apr 2025 16:31:15 -0300 Subject: [PATCH] lncfg: validate BlindedPaths.MaxNumPaths Assert that the BlindedPaths.MaxNumPaths value is non-zero. --- lncfg/routing.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lncfg/routing.go b/lncfg/routing.go index 2b21683f6..896757887 100644 --- a/lncfg/routing.go +++ b/lncfg/routing.go @@ -34,6 +34,10 @@ func (r *Routing) Validate() error { "number of hops expected to be included in each path") } + if r.BlindedPaths.MaxNumPaths == 0 { + return fmt.Errorf("blinded max num paths cannot be 0") + } + if r.BlindedPaths.PolicyIncreaseMultiplier < 1 { return fmt.Errorf("the blinded route policy increase " + "multiplier must be greater than or equal to 1")