mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-01 02:30:28 +02:00
lnrpc: add first hop records field to SendPayment
This commit is contained in:
parent
7a3246855f
commit
3a53b16549
File diff suppressed because it is too large
Load Diff
@ -330,6 +330,15 @@ message SendPaymentRequest {
|
||||
only, to 1 to optimize for reliability only or a value inbetween for a mix.
|
||||
*/
|
||||
double time_pref = 23;
|
||||
|
||||
/*
|
||||
An optional field that can be used to pass an arbitrary set of TLV records
|
||||
to the first hop peer of this payment. This can be used to pass application
|
||||
specific data during the payment attempt. Record types are required to be in
|
||||
the custom range >= 65536. When using REST, the values must be encoded as
|
||||
base64.
|
||||
*/
|
||||
map<uint64, bytes> first_hop_custom_records = 24;
|
||||
}
|
||||
|
||||
message TrackPaymentRequest {
|
||||
|
@ -1802,6 +1802,14 @@
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"description": "The time preference for this payment. Set to -1 to optimize for fees\nonly, to 1 to optimize for reliability only or a value inbetween for a mix."
|
||||
},
|
||||
"first_hop_custom_records": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"format": "byte"
|
||||
},
|
||||
"description": "An optional field that can be used to pass an arbitrary set of TLV records\nto the first hop peer of this payment. This can be used to pass application\nspecific data during the payment attempt. Record types are required to be in\nthe custom range \u003e= 65536. When using REST, the values must be encoded as\nbase64."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -858,6 +858,12 @@ func (r *RouterBackend) extractIntentFromSendRequest(
|
||||
}
|
||||
payIntent.DestCustomRecords = customRecords
|
||||
|
||||
firstHopRecords := record.CustomSet(rpcPayReq.FirstHopCustomRecords)
|
||||
if err := firstHopRecords.Validate(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
payIntent.FirstHopCustomRecords = firstHopRecords
|
||||
|
||||
payIntent.PayAttemptTimeout = time.Second *
|
||||
time.Duration(rpcPayReq.TimeoutSeconds)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user