multi: add blinding point to payment descriptor and persist
This commit adds an optional blinding point to payment descriptors and persists them in our HTLC's extra data. A get/set pattern is used to populate the ExtraData on our disk representation of the HTLC so that callers do not need to worry about the underlying storage detail.
This commit is contained in:
5 files changed
+246
-40
No files matched your search
@@ -78,6 +78,19 @@ type UpdateAddHTLC struct {
|
||||
ExtraData ExtraOpaqueData
|
||||
}
|
||||
|
||||
// BlingingPointOrNil returns the blinding point associated with the update, or
|
||||
// nil.
|
||||
func (c *UpdateAddHTLC) BlingingPointOrNil() *btcec.PublicKey {
|
||||
var blindingPoint *btcec.PublicKey
|
||||
c.BlindingPoint.WhenSome(func(b tlv.RecordT[BlindingPointTlvType,
|
||||
*btcec.PublicKey]) {
|
||||
|
||||
blindingPoint = b.Val
|
||||
})
|
||||
|
||||
return blindingPoint
|
||||
}
|
||||
|
||||
// NewUpdateAddHTLC returns a new empty UpdateAddHTLC message.
|
||||
func NewUpdateAddHTLC() *UpdateAddHTLC {
|
||||
return &UpdateAddHTLC{}
|
||||
|
||||
Reference in new issue
Block a user