mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-15 03:51:23 +01:00
lnrpc: add payment cltv limit
This commit is contained in:
parent
06cd64cbbc
commit
acb8fd4796
4 changed files with 614 additions and 583 deletions
1178
lnrpc/rpc.pb.go
1178
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load diff
|
@ -790,7 +790,14 @@ message SendRequest {
|
||||||
any channel may be used.
|
any channel may be used.
|
||||||
*/
|
*/
|
||||||
uint64 outgoing_chan_id = 9;
|
uint64 outgoing_chan_id = 9;
|
||||||
|
|
||||||
|
/**
|
||||||
|
An optional maximum total time lock for the route. If zero, there is no
|
||||||
|
maximum enforced.
|
||||||
|
*/
|
||||||
|
uint32 cltv_limit = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SendResponse {
|
message SendResponse {
|
||||||
string payment_error = 1 [json_name = "payment_error"];
|
string payment_error = 1 [json_name = "payment_error"];
|
||||||
bytes payment_preimage = 2 [json_name = "payment_preimage"];
|
bytes payment_preimage = 2 [json_name = "payment_preimage"];
|
||||||
|
|
|
@ -2977,6 +2977,11 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "uint64",
|
"format": "uint64",
|
||||||
"description": "*\nThe channel id of the channel that must be taken to the first hop. If zero,\nany channel may be used."
|
"description": "*\nThe channel id of the channel that must be taken to the first hop. If zero,\nany channel may be used."
|
||||||
|
},
|
||||||
|
"cltv_limit": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "* \nAn optional maximum total time lock for the route. If zero, there is no\nmaximum enforced."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2852,6 +2852,7 @@ func unmarshallSendToRouteRequest(req *lnrpc.SendToRouteRequest,
|
||||||
type rpcPaymentIntent struct {
|
type rpcPaymentIntent struct {
|
||||||
msat lnwire.MilliSatoshi
|
msat lnwire.MilliSatoshi
|
||||||
feeLimit lnwire.MilliSatoshi
|
feeLimit lnwire.MilliSatoshi
|
||||||
|
cltvLimit *uint32
|
||||||
dest routing.Vertex
|
dest routing.Vertex
|
||||||
rHash [32]byte
|
rHash [32]byte
|
||||||
cltvDelta uint16
|
cltvDelta uint16
|
||||||
|
@ -2895,6 +2896,11 @@ func extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPaymentIntent, error
|
||||||
payIntent.outgoingChannelID = &rpcPayReq.OutgoingChanId
|
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
|
// If the payment request field isn't blank, then the details of the
|
||||||
// invoice are encoded entirely within the encoded payReq. So we'll
|
// invoice are encoded entirely within the encoded payReq. So we'll
|
||||||
// attempt to decode it, populating the payment accordingly.
|
// attempt to decode it, populating the payment accordingly.
|
||||||
|
@ -3044,6 +3050,7 @@ func (r *rpcServer) dispatchPaymentIntent(
|
||||||
Target: payIntent.dest,
|
Target: payIntent.dest,
|
||||||
Amount: payIntent.msat,
|
Amount: payIntent.msat,
|
||||||
FeeLimit: payIntent.feeLimit,
|
FeeLimit: payIntent.feeLimit,
|
||||||
|
CltvLimit: payIntent.cltvLimit,
|
||||||
PaymentHash: payIntent.rHash,
|
PaymentHash: payIntent.rHash,
|
||||||
RouteHints: payIntent.routeHints,
|
RouteHints: payIntent.routeHints,
|
||||||
OutgoingChannelID: payIntent.outgoingChannelID,
|
OutgoingChannelID: payIntent.outgoingChannelID,
|
||||||
|
|
Loading…
Add table
Reference in a new issue