invoices: expose AMPRecord() method on Payload

This commit is contained in:
Conner Fromknecht
2021-03-03 09:54:11 -08:00
parent 055db6b9ac
commit 464dff09ac
5 changed files with 24 additions and 2 deletions

View File

@@ -86,6 +86,10 @@ type Payload struct {
// a TLV onion payload.
MPP *record.MPP
// AMP holds the info provided in an option_amp record when parsed from
// a TLV onion payload.
AMP *record.AMP
// customRecords are user-defined records in the custom type range that
// were included in the payload.
customRecords record.CustomSet
@@ -250,6 +254,12 @@ func (h *Payload) MultiPath() *record.MPP {
return h.MPP
}
// AMPRecord returns the record corresponding with option_amp parsed from the
// onion payload.
func (h *Payload) AMPRecord() *record.AMP {
return h.AMP
}
// CustomRecords returns the custom tlv type records that were parsed from the
// payload.
func (h *Payload) CustomRecords() record.CustomSet {