rpc: in createRPCInvoice properly populate CltvExpiry

This commit is contained in:
Olaoluwa Osuntokun committed 2017-10-22 18:36:55 -07:00
1 parent 5bc906dd18
commit 22881ec05e
1 file changed
+4
+4
View File
@@ -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
}