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`.
This commit is contained in:
Abdullahi Yunus
2025-07-22 21:37:34 +01:00
parent 40fe9e9ce3
commit 35c6cecd22

View File

@@ -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") {