Documentation
¶
Index ¶
- Constants
- func MPPDecoder(r io.Reader, val interface{}, buf *[8]byte, l uint64) error
- func MPPEncoder(w io.Writer, val interface{}, buf *[8]byte) error
- func NewAmtToFwdRecord(amt *uint64) tlv.Record
- func NewLockTimeRecord(lockTime *uint32) tlv.Record
- func NewNextHopIDRecord(cid *uint64) tlv.Record
- type CustomSet
- type MPP
Constants ¶
const ( // AmtOnionType is the type used in the onion to refrence the amount to // send to the next hop. AmtOnionType tlv.Type = 2 // LockTimeTLV is the type used in the onion to refenernce the CLTV // value that should be used for the next hop's HTLC. LockTimeOnionType tlv.Type = 4 // NextHopOnionType is the type used in the onion to reference the ID // of the next hop. NextHopOnionType tlv.Type = 6 )
const ( // CustomTypeStart is the start of the custom tlv type range as defined // in BOLT 01. CustomTypeStart = 65536 )
const ( // KeySendType is the custom record identifier for key send preimages. KeySendType uint64 = 5482373484 )
const MPPOnionType tlv.Type = 8
MPPOnionType is the type used in the onion to reference the MPP fields: total_amt and payment_addr.
Variables ¶
This section is empty.
Functions ¶
func MPPDecoder ¶
MPPDecoder reads the MPP record to the provided io.Reader.
func MPPEncoder ¶
MPPEncoder writes the MPP record to the provided io.Writer.
func NewAmtToFwdRecord ¶
NewAmtToFwdRecord creates a tlv.Record that encodes the amount_to_forward (type 2) for an onion payload.
func NewLockTimeRecord ¶
NewLockTimeRecord creates a tlv.Record that encodes the outgoing_cltv_value (type 4) for an onion payload.
func NewNextHopIDRecord ¶
NewNextHopIDRecord creates a tlv.Record that encodes the short_channel_id (type 6) for an onion payload.
Types ¶
type MPP ¶
type MPP struct {
// contains filtered or unexported fields
}
MPP is a record that encodes the fields necessary for multi-path payments.
func NewMPP ¶
func NewMPP(total lnwire.MilliSatoshi, addr [32]byte) *MPP
NewMPP generates a new MPP record with the given total and payment address.
func (*MPP) PayloadSize ¶
PayloadSize returns the size this record takes up in encoded form.
func (*MPP) PaymentAddr ¶
PaymentAddr returns the payment address contained in the MPP record.
func (*MPP) TotalMsat ¶
func (r *MPP) TotalMsat() lnwire.MilliSatoshi
TotalMsat returns the total value of an MPP payment in msats.