From 35c6cecd22492d484f0f32406f3c9e6cfeae5cae Mon Sep 17 00:00:00 2001 From: Abdullahi Yunus Date: Tue, 22 Jul 2025 21:37:34 +0100 Subject: [PATCH] commands: use parseChanIDs method In this commit we use the `parseChanIDs` method introduced in a previous commit to process the `outgoing_chan_id` flag for `queryroutes`. --- cmd/commands/cmd_payments.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/cmd/commands/cmd_payments.go b/cmd/commands/cmd_payments.go index a33eba369..d13b52da2 100644 --- a/cmd/commands/cmd_payments.go +++ b/cmd/commands/cmd_payments.go @@ -1281,17 +1281,9 @@ func queryRoutes(ctx *cli.Context) error { } outgoingChanIds := ctx.StringSlice("outgoing_chan_id") - if len(outgoingChanIds) != 0 { - req.OutgoingChanIds = make([]uint64, len(outgoingChanIds)) - for i, chanID := range outgoingChanIds { - id, err := strconv.ParseUint(chanID, 10, 64) - if err != nil { - return fmt.Errorf("invalid outgoing_chan_id "+ - "argument: %w", err) - } - - req.OutgoingChanIds[i] = id - } + req.OutgoingChanIds, err = parseChanIDs(outgoingChanIds) + if err != nil { + return fmt.Errorf("unable to decode outgoing_chan_id: %w", err) } if ctx.IsSet("route_hints") {