rpc: in createRPCInvoice properly populate CltvExpiry
This commit is contained in:
parent
5bc906dd18
commit
22881ec05e
@ -1943,6 +1943,9 @@ func createRPCInvoice(invoice *channeldb.Invoice) (*lnrpc.Invoice, error) {
|
|||||||
// explicitly.
|
// explicitly.
|
||||||
expiry := int64(decoded.Expiry().Seconds())
|
expiry := int64(decoded.Expiry().Seconds())
|
||||||
|
|
||||||
|
// The expiry will default to 9 blocks if not specified explicitly.
|
||||||
|
cltvExpiry := decoded.MinFinalCLTVExpiry()
|
||||||
|
|
||||||
preimage := invoice.Terms.PaymentPreimage
|
preimage := invoice.Terms.PaymentPreimage
|
||||||
satAmt := invoice.Terms.Value.ToSatoshis()
|
satAmt := invoice.Terms.Value.ToSatoshis()
|
||||||
|
|
||||||
@ -1957,6 +1960,7 @@ func createRPCInvoice(invoice *channeldb.Invoice) (*lnrpc.Invoice, error) {
|
|||||||
PaymentRequest: paymentRequest,
|
PaymentRequest: paymentRequest,
|
||||||
DescriptionHash: descHash,
|
DescriptionHash: descHash,
|
||||||
Expiry: expiry,
|
Expiry: expiry,
|
||||||
|
CltvExpiry: cltvExpiry,
|
||||||
FallbackAddr: fallbackAddr,
|
FallbackAddr: fallbackAddr,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user