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,
|
||||
cltvLimitFlag,
|
||||
lastHopFlag,
|
||||
cli.Int64SliceFlag{
|
||||
cli.StringSliceFlag{
|
||||
Name: "outgoing_chan_id",
|
||||
Usage: "short channel id of the outgoing channel to " +
|
||||
"use for the first hop of the payment; can " +
|
||||
"be specified multiple times in the same " +
|
||||
"command",
|
||||
Value: &cli.Int64Slice{},
|
||||
Value: &cli.StringSlice{},
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "force, f",
|
||||
@@ -521,12 +521,11 @@ func SendPaymentRequest(ctx *cli.Context, req *routerrpc.SendPaymentRequest,
|
||||
|
||||
lnClient := lnrpc.NewLightningClient(lnConn)
|
||||
|
||||
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)
|
||||
}
|
||||
var err error
|
||||
outChan := ctx.StringSlice("outgoing_chan_id")
|
||||
req.OutgoingChanIds, err = parseChanIDs(outChan)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode outgoing_chan_ids: %w", err)
|
||||
}
|
||||
|
||||
if ctx.IsSet(lastHopFlag.Name) {
|
||||
|
Reference in New Issue
Block a user