routing+channeldb: send payment metadata from invoice

This commit is contained in:
Joost Jager committed 2022-04-13 22:55:40 +02:00
1 parent 135e27ddd3
commit 9195f29e61
17 files changed
+1580 -1401

No files matched your search

+1410 -1399
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -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 {
+5
View File
@@ -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."
}
}
},
+5
View File
@@ -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."
}
}
},
+2
View File
@@ -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