File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -639,6 +639,12 @@ static struct command_result *do_getroutes(struct command *cmd,
639639 "Layer no_mpp_support is active we switch to a "
640640 "single path algorithm." );
641641 }
642+ if (rq -> maxparts == 1 &&
643+ info -> dev_algo != ALGO_SINGLE_PATH ) {
644+ info -> dev_algo = ALGO_SINGLE_PATH ;
645+ rq_log (tmpctx , rq , LOG_DBG ,
646+ "maxparts == 1: switching to a single path algorithm." );
647+ }
642648
643649 /* Compute the routes. At this point we might select between multiple
644650 * algorithms. Right now there is only one algorithm available. */
@@ -830,6 +836,11 @@ static struct command_result *json_getroutes(struct command *cmd,
830836 "amount must be non-zero" );
831837 }
832838
839+ if (maxparts == 0 ) {
840+ return command_fail (cmd , JSONRPC2_INVALID_PARAMS ,
841+ "maxparts must be non-zero" );
842+ }
843+
833844 if (* maxdelay > maxdelay_allowed ) {
834845 return command_fail (cmd , PAY_USER_ERROR ,
835846 "maximum delay allowed is %d" ,
You can’t perform that action at this time.
0 commit comments