mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-04 02:36:17 +02:00
commands: use StringSlice flag for send payment
In this commit we replace the Int64Slice flag with StringSlice for chan id flag, in sendpayment request.
This commit is contained in:
@@ -183,13 +183,13 @@ func PaymentFlags() []cli.Flag {
|
|||||||
cancelableFlag,
|
cancelableFlag,
|
||||||
cltvLimitFlag,
|
cltvLimitFlag,
|
||||||
lastHopFlag,
|
lastHopFlag,
|
||||||
cli.Int64SliceFlag{
|
cli.StringSliceFlag{
|
||||||
Name: "outgoing_chan_id",
|
Name: "outgoing_chan_id",
|
||||||
Usage: "short channel id of the outgoing channel to " +
|
Usage: "short channel id of the outgoing channel to " +
|
||||||
"use for the first hop of the payment; can " +
|
"use for the first hop of the payment; can " +
|
||||||
"be specified multiple times in the same " +
|
"be specified multiple times in the same " +
|
||||||
"command",
|
"command",
|
||||||
Value: &cli.Int64Slice{},
|
Value: &cli.StringSlice{},
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "force, f",
|
Name: "force, f",
|
||||||
@@ -521,12 +521,11 @@ func SendPaymentRequest(ctx *cli.Context, req *routerrpc.SendPaymentRequest,
|
|||||||
|
|
||||||
lnClient := lnrpc.NewLightningClient(lnConn)
|
lnClient := lnrpc.NewLightningClient(lnConn)
|
||||||
|
|
||||||
outChan := ctx.Int64Slice("outgoing_chan_id")
|
var err error
|
||||||
if len(outChan) != 0 {
|
outChan := ctx.StringSlice("outgoing_chan_id")
|
||||||
req.OutgoingChanIds = make([]uint64, len(outChan))
|
req.OutgoingChanIds, err = parseChanIDs(outChan)
|
||||||
for i, c := range outChan {
|
if err != nil {
|
||||||
req.OutgoingChanIds[i] = uint64(c)
|
return fmt.Errorf("unable to decode outgoing_chan_ids: %w", err)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet(lastHopFlag.Name) {
|
if ctx.IsSet(lastHopFlag.Name) {
|
||||||
|
Reference in New Issue
Block a user