mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-26 14:08:41 +01:00
lnrpc: add payment cltv limit
This commit is contained in:
committed by
Joost Jager
parent
06cd64cbbc
commit
acb8fd4796
@@ -2852,6 +2852,7 @@ func unmarshallSendToRouteRequest(req *lnrpc.SendToRouteRequest,
|
||||
type rpcPaymentIntent struct {
|
||||
msat lnwire.MilliSatoshi
|
||||
feeLimit lnwire.MilliSatoshi
|
||||
cltvLimit *uint32
|
||||
dest routing.Vertex
|
||||
rHash [32]byte
|
||||
cltvDelta uint16
|
||||
@@ -2895,6 +2896,11 @@ func extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPaymentIntent, error
|
||||
payIntent.outgoingChannelID = &rpcPayReq.OutgoingChanId
|
||||
}
|
||||
|
||||
// Take cltv limit from request if set.
|
||||
if rpcPayReq.CltvLimit != 0 {
|
||||
payIntent.cltvLimit = &rpcPayReq.CltvLimit
|
||||
}
|
||||
|
||||
// If the payment request field isn't blank, then the details of the
|
||||
// invoice are encoded entirely within the encoded payReq. So we'll
|
||||
// attempt to decode it, populating the payment accordingly.
|
||||
@@ -3044,6 +3050,7 @@ func (r *rpcServer) dispatchPaymentIntent(
|
||||
Target: payIntent.dest,
|
||||
Amount: payIntent.msat,
|
||||
FeeLimit: payIntent.feeLimit,
|
||||
CltvLimit: payIntent.cltvLimit,
|
||||
PaymentHash: payIntent.rHash,
|
||||
RouteHints: payIntent.routeHints,
|
||||
OutgoingChannelID: payIntent.outgoingChannelID,
|
||||
|
||||
Reference in New Issue
Block a user