routing+channeldb: send payment metadata from invoice
This commit is contained in:
17 files changed
+1580
-1401
No files matched your search
+1410
-1399
File diff suppressed because it is too large.
Load diff
@@ -2792,6 +2792,9 @@ message Hop {
|
||||
to drop off at each hop within the onion.
|
||||
*/
|
||||
map<uint64, bytes> custom_records = 11;
|
||||
|
||||
// The payment metadata to send along with the payment to the payee.
|
||||
bytes metadata = 13;
|
||||
}
|
||||
|
||||
message MPPRecord {
|
||||
|
||||
@@ -4616,6 +4616,11 @@
|
||||
"format": "byte"
|
||||
},
|
||||
"description": "An optional set of key-value TLV records. This is useful within the context\nof the SendToRoute call as it allows callers to specify arbitrary K-V pairs\nto drop off at each hop within the onion."
|
||||
},
|
||||
"metadata": {
|
||||
"type": "string",
|
||||
"format": "byte",
|
||||
"description": "The payment metadata to send along with the payment to the payee."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -819,6 +819,11 @@
|
||||
"format": "byte"
|
||||
},
|
||||
"description": "An optional set of key-value TLV records. This is useful within the context\nof the SendToRoute call as it allows callers to specify arbitrary K-V pairs\nto drop off at each hop within the onion."
|
||||
},
|
||||
"metadata": {
|
||||
"type": "string",
|
||||
"format": "byte",
|
||||
"description": "The payment metadata to send along with the payment to the payee."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -444,6 +444,7 @@ func (r *RouterBackend) MarshallRoute(route *route.Route) (*lnrpc.Route, error)
|
||||
CustomRecords: hop.CustomRecords,
|
||||
TlvPayload: !hop.LegacyPayload,
|
||||
MppRecord: mpp,
|
||||
Metadata: hop.Metadata,
|
||||
}
|
||||
incomingAmt = hop.AmtToForward
|
||||
}
|
||||
@@ -766,6 +767,7 @@ func (r *RouterBackend) extractIntentFromSendRequest(
|
||||
payIntent.DestFeatures = payReq.Features
|
||||
payIntent.PaymentAddr = payAddr
|
||||
payIntent.PaymentRequest = []byte(rpcPayReq.PaymentRequest)
|
||||
payIntent.Metadata = payReq.Metadata
|
||||
} else {
|
||||
// Otherwise, If the payment request field was not specified
|
||||
// (and a custom route wasn't specified), construct the payment
|
||||
|
||||
Reference in new issue
Block a user