mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-25 16:23:49 +02:00
Merge pull request #8491 from davidgumberg/invoice_cltv_expiry
Expose `cltv_expiry` flag of `addinvoice` to cli
This commit is contained in:
commit
a832371d61
@ -60,6 +60,14 @@ var addInvoiceCommand = cli.Command{
|
|||||||
"specified, an expiry of " +
|
"specified, an expiry of " +
|
||||||
"86400 seconds (24 hours) is implied.",
|
"86400 seconds (24 hours) is implied.",
|
||||||
},
|
},
|
||||||
|
cli.Uint64Flag{
|
||||||
|
Name: "cltv_expiry_delta",
|
||||||
|
Usage: "The minimum CLTV delta to use for the final " +
|
||||||
|
"hop. If this is set to 0, the default value " +
|
||||||
|
"is used. The default value for " +
|
||||||
|
"cltv_expiry_delta is configured by the " +
|
||||||
|
"'bitcoin.timelockdelta' option.",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "private",
|
Name: "private",
|
||||||
Usage: "encode routing hints in the invoice with " +
|
Usage: "encode routing hints in the invoice with " +
|
||||||
@ -127,6 +135,7 @@ func addInvoice(ctx *cli.Context) error {
|
|||||||
DescriptionHash: descHash,
|
DescriptionHash: descHash,
|
||||||
FallbackAddr: ctx.String("fallback_addr"),
|
FallbackAddr: ctx.String("fallback_addr"),
|
||||||
Expiry: ctx.Int64("expiry"),
|
Expiry: ctx.Int64("expiry"),
|
||||||
|
CltvExpiry: ctx.Uint64("cltv_expiry_delta"),
|
||||||
Private: ctx.Bool("private"),
|
Private: ctx.Bool("private"),
|
||||||
IsAmp: ctx.Bool("amp"),
|
IsAmp: ctx.Bool("amp"),
|
||||||
}
|
}
|
||||||
|
@ -184,6 +184,14 @@ var addHoldInvoiceCommand = cli.Command{
|
|||||||
"specified, an expiry of " +
|
"specified, an expiry of " +
|
||||||
"86400 seconds (24 hours) is implied.",
|
"86400 seconds (24 hours) is implied.",
|
||||||
},
|
},
|
||||||
|
cli.Uint64Flag{
|
||||||
|
Name: "cltv_expiry_delta",
|
||||||
|
Usage: "The minimum CLTV delta to use for the final " +
|
||||||
|
"hop. If this is set to 0, the default value " +
|
||||||
|
"is used. The default value for " +
|
||||||
|
"cltv_expiry_delta is configured by the " +
|
||||||
|
"'bitcoin.timelockdelta' option.",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "private",
|
Name: "private",
|
||||||
Usage: "encode routing hints in the invoice with " +
|
Usage: "encode routing hints in the invoice with " +
|
||||||
@ -241,6 +249,7 @@ func addHoldInvoice(ctx *cli.Context) error {
|
|||||||
DescriptionHash: descHash,
|
DescriptionHash: descHash,
|
||||||
FallbackAddr: ctx.String("fallback_addr"),
|
FallbackAddr: ctx.String("fallback_addr"),
|
||||||
Expiry: ctx.Int64("expiry"),
|
Expiry: ctx.Int64("expiry"),
|
||||||
|
CltvExpiry: ctx.Uint64("cltv_expiry_delta"),
|
||||||
Private: ctx.Bool("private"),
|
Private: ctx.Bool("private"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
## RPC Additions
|
## RPC Additions
|
||||||
## lncli Additions
|
## lncli Additions
|
||||||
|
|
||||||
|
* [Added](https://github.com/lightningnetwork/lnd/pull/8491) the `cltv_expiry`
|
||||||
|
argument to `addinvoice` and `addholdinvoice`, allowing users to set the
|
||||||
|
`min_final_cltv_expiry_delta`
|
||||||
|
|
||||||
# Improvements
|
# Improvements
|
||||||
## Functional Updates
|
## Functional Updates
|
||||||
## RPC Updates
|
## RPC Updates
|
||||||
|
@ -367,7 +367,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
|
|||||||
if invoice.CltvExpiry < routing.MinCLTVDelta {
|
if invoice.CltvExpiry < routing.MinCLTVDelta {
|
||||||
return nil, nil, fmt.Errorf("CLTV delta of %v must be "+
|
return nil, nil, fmt.Errorf("CLTV delta of %v must be "+
|
||||||
"greater than minimum of %v",
|
"greater than minimum of %v",
|
||||||
routing.MinCLTVDelta, invoice.CltvExpiry)
|
invoice.CltvExpiry, routing.MinCLTVDelta)
|
||||||
}
|
}
|
||||||
|
|
||||||
options = append(options,
|
options = append(options,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user