multi: extract path ID and total amt from received payment

We've covered all the logic for building a blinded path to ourselves and
putting that into an invoice - so now we start preparing to actually be
able to recognise the incoming payment as one from a blinded path we
created.

The incoming update_add_htlc will have an `encrypted_recipient_data`
blob for us that we would have put in the original invoice. From this we
extract the PathID which we wrote. We consider this the payment address
and we use this to derive the associated invoice location.

Blinded path payments will not include MPP records, so the payment
address and total payment amount must be gleaned from the pathID and new
totalAmtMsat onion field respectively.

This commit only covers the final hop payload of a hop in a blinded
path. Dummy hops will be handled in the following commit.
This commit is contained in:
Elle Mouton committed 2024-07-26 09:54:18 +02:00
1 parent 3d9c77d1fc
commit b0d3e4dc0d
8 files changed
+94 -18

No files matched your search

+10
View File
@@ -30,6 +30,8 @@ type mockPayload struct {
amp *record.AMP
customRecords record.CustomSet
metadata []byte
pathID *chainhash.Hash
totalAmtMsat lnwire.MilliSatoshi
}
func (p *mockPayload) MultiPath() *record.MPP {
@@ -40,6 +42,14 @@ func (p *mockPayload) AMPRecord() *record.AMP {
return p.amp
}
func (p *mockPayload) PathID() *chainhash.Hash {
return p.pathID
}
func (p *mockPayload) TotalAmtMsat() lnwire.MilliSatoshi {
return p.totalAmtMsat
}
func (p *mockPayload) CustomRecords() record.CustomSet {
// This function should always return a map instance, but for mock
// configuration we do accept nil.