From 72a56f56b4dd7dc8d6db021a9408097e6731afcf Mon Sep 17 00:00:00 2001 From: Marcos Date: Fri, 8 Dec 2023 00:45:20 +0100 Subject: [PATCH 1/2] lncli: enable multiple outgoing channel ids in payments --- cmd/lncli/cmd_payments.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/lncli/cmd_payments.go b/cmd/lncli/cmd_payments.go index 37b681d29..3b0904ee0 100644 --- a/cmd/lncli/cmd_payments.go +++ b/cmd/lncli/cmd_payments.go @@ -169,11 +169,13 @@ func paymentFlags() []cli.Flag { }, cltvLimitFlag, lastHopFlag, - cli.Uint64Flag{ + cli.Int64SliceFlag{ Name: "outgoing_chan_id", Usage: "short channel id of the outgoing channel to " + - "use for the first hop of the payment", - Value: 0, + "use for the first hop of the payment; can " + + "be specified multiple times in the same " + + "command", + Value: &cli.Int64Slice{}, }, cli.BoolFlag{ Name: "force, f", @@ -463,10 +465,14 @@ func sendPaymentRequest(ctx *cli.Context, client := lnrpc.NewLightningClient(conn) routerClient := routerrpc.NewRouterClient(conn) - outChan := ctx.Uint64("outgoing_chan_id") - if outChan != 0 { - req.OutgoingChanIds = []uint64{outChan} + outChan := ctx.Int64Slice("outgoing_chan_id") + if len(outChan) != 0 { + req.OutgoingChanIds = make([]uint64, len(outChan)) + for i, c := range outChan { + req.OutgoingChanIds[i] = uint64(c) + } } + if ctx.IsSet(lastHopFlag.Name) { lastHop, err := route.NewVertexFromStr( ctx.String(lastHopFlag.Name), From ea9a780203e973ef85b43b574c7246276ec97a25 Mon Sep 17 00:00:00 2001 From: Marcos Date: Fri, 8 Dec 2023 00:56:31 +0100 Subject: [PATCH 2/2] docs: release notes update for 0.18.0 --- docs/release-notes/release-notes-0.18.0.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/release-notes/release-notes-0.18.0.md b/docs/release-notes/release-notes-0.18.0.md index 59ded9784..1d92a4f91 100644 --- a/docs/release-notes/release-notes-0.18.0.md +++ b/docs/release-notes/release-notes-0.18.0.md @@ -117,6 +117,11 @@ in the rpc definition to ensure that the autogenerated API documentation properly specifies how to use the lncli command. +* [Enable multiple outgoing channel ids for the payment + command](https://github.com/lightningnetwork/lnd/pull/8261). This change adds + the ability to specify multiple outgoing channel ids for the `sendpayment` + command. + ## Code Health * [Remove Litecoin code](https://github.com/lightningnetwork/lnd/pull/7867).