Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multiple outgoing channel ids in payments #8261

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 12 additions & 6 deletions cmd/lncli/cmd_payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
guggero marked this conversation as resolved.
Show resolved Hide resolved
},
cli.BoolFlag{
Name: "force, f",
Expand Down Expand Up @@ -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),
Expand Down
5 changes: 5 additions & 0 deletions docs/release-notes/release-notes-0.18.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down