mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-11 22:24:14 +02:00
lnwallet: allow read-only access to HtlcView's HTLCs
Due to a recent refactor, the HTLCs are no longer an exported type. Custom channels need access to those updates, so we provide them in a read-only manner.
This commit is contained in:
@@ -2545,6 +2545,18 @@ type HtlcView struct {
|
||||
FeePerKw chainfee.SatPerKWeight
|
||||
}
|
||||
|
||||
// AuxOurUpdates returns the outgoing HTLCs as a read-only copy of
|
||||
// AuxHtlcDescriptors.
|
||||
func (v *HtlcView) AuxOurUpdates() []AuxHtlcDescriptor {
|
||||
return fn.Map(newAuxHtlcDescriptor, v.OurUpdates)
|
||||
}
|
||||
|
||||
// AuxTheirUpdates returns the incoming HTLCs as a read-only copy of
|
||||
// AuxHtlcDescriptors.
|
||||
func (v *HtlcView) AuxTheirUpdates() []AuxHtlcDescriptor {
|
||||
return fn.Map(newAuxHtlcDescriptor, v.TheirUpdates)
|
||||
}
|
||||
|
||||
// fetchHTLCView returns all the candidate HTLC updates which should be
|
||||
// considered for inclusion within a commitment based on the passed HTLC log
|
||||
// indexes.
|
||||
|
Reference in New Issue
Block a user