From 22881ec05ee618a6a8cb1704a6392fd6d3f61ced Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 18 Oct 2017 22:15:52 -0700 Subject: [PATCH] rpc: in createRPCInvoice properly populate CltvExpiry --- rpcserver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 8efbdb4d..82e6fdc2 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1943,6 +1943,9 @@ func createRPCInvoice(invoice *channeldb.Invoice) (*lnrpc.Invoice, error) { // explicitly. expiry := int64(decoded.Expiry().Seconds()) + // The expiry will default to 9 blocks if not specified explicitly. + cltvExpiry := decoded.MinFinalCLTVExpiry() + preimage := invoice.Terms.PaymentPreimage satAmt := invoice.Terms.Value.ToSatoshis() @@ -1957,6 +1960,7 @@ func createRPCInvoice(invoice *channeldb.Invoice) (*lnrpc.Invoice, error) { PaymentRequest: paymentRequest, DescriptionHash: descHash, Expiry: expiry, + CltvExpiry: cltvExpiry, FallbackAddr: fallbackAddr, }, nil }