mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-28 10:41:57 +01:00
lncli: add cltv limit
This commit is contained in:
parent
acb8fd4796
commit
ec0d241905
@ -1954,6 +1954,12 @@ func closedChannels(ctx *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cltvLimitFlag = cli.UintFlag{
|
||||||
|
Name: "cltv_limit",
|
||||||
|
Usage: "the maximum time lock that may be used for " +
|
||||||
|
"this payment",
|
||||||
|
}
|
||||||
|
|
||||||
var sendPaymentCommand = cli.Command{
|
var sendPaymentCommand = cli.Command{
|
||||||
Name: "sendpayment",
|
Name: "sendpayment",
|
||||||
Category: "Payments",
|
Category: "Payments",
|
||||||
@ -2000,6 +2006,7 @@ var sendPaymentCommand = cli.Command{
|
|||||||
Usage: "percentage of the payment's amount used as the" +
|
Usage: "percentage of the payment's amount used as the" +
|
||||||
"maximum fee allowed when sending the payment",
|
"maximum fee allowed when sending the payment",
|
||||||
},
|
},
|
||||||
|
cltvLimitFlag,
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "payment_hash, r",
|
Name: "payment_hash, r",
|
||||||
Usage: "the hash to use within the payment's HTLC",
|
Usage: "the hash to use within the payment's HTLC",
|
||||||
@ -2119,6 +2126,7 @@ func sendPayment(ctx *cli.Context) error {
|
|||||||
Amt: ctx.Int64("amt"),
|
Amt: ctx.Int64("amt"),
|
||||||
FeeLimit: feeLimit,
|
FeeLimit: feeLimit,
|
||||||
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
|
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
|
||||||
|
CltvLimit: uint32(ctx.Int(cltvLimitFlag.Name)),
|
||||||
}
|
}
|
||||||
|
|
||||||
return sendPaymentRequest(client, req)
|
return sendPaymentRequest(client, req)
|
||||||
@ -2266,6 +2274,7 @@ var payInvoiceCommand = cli.Command{
|
|||||||
Usage: "percentage of the payment's amount used as the" +
|
Usage: "percentage of the payment's amount used as the" +
|
||||||
"maximum fee allowed when sending the payment",
|
"maximum fee allowed when sending the payment",
|
||||||
},
|
},
|
||||||
|
cltvLimitFlag,
|
||||||
cli.Uint64Flag{
|
cli.Uint64Flag{
|
||||||
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 " +
|
||||||
@ -2312,7 +2321,9 @@ func payInvoice(ctx *cli.Context) error {
|
|||||||
Amt: ctx.Int64("amt"),
|
Amt: ctx.Int64("amt"),
|
||||||
FeeLimit: feeLimit,
|
FeeLimit: feeLimit,
|
||||||
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
|
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
|
||||||
|
CltvLimit: uint32(ctx.Int(cltvLimitFlag.Name)),
|
||||||
}
|
}
|
||||||
|
|
||||||
return sendPaymentRequest(client, req)
|
return sendPaymentRequest(client, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user