multi: Fix final hop payload size for AMP payments.

This commit is contained in:
ziggie
2024-02-03 12:09:11 +00:00
parent ff30ff40bf
commit 4732c09a26
7 changed files with 44 additions and 1 deletions

View File

@@ -19,6 +19,16 @@ type AMP struct {
childIndex uint32
}
// MaxAmpPayLoadSize is an AMP Record which when serialized to a tlv record uses
// the maximum payload size. The `childIndex` is created randomly and is a
// 4 byte `varint` type so we make sure we use an index which will be encoded in
// 4 bytes.
var MaxAmpPayLoadSize = AMP{
rootShare: [32]byte{},
setID: [32]byte{},
childIndex: 0x80000000,
}
// NewAMP generate a new AMP record with the given root_share, set_id, and
// child_index.
func NewAMP(rootShare, setID [32]byte, childIndex uint32) *AMP {