mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 12:03:24 +02:00
htlcswitch: expose custom channel blob from link
This commit is contained in:
committed by
Oliver Gugger
parent
5cb68a59c5
commit
5dcda25881
@@ -31,6 +31,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/queue"
|
||||
"github.com/lightningnetwork/lnd/ticker"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -4105,3 +4106,28 @@ func (l *channelLink) failf(linkErr LinkFailureError, format string,
|
||||
l.failed = true
|
||||
l.cfg.OnChannelFailure(l.ChanID(), l.ShortChanID(), linkErr)
|
||||
}
|
||||
|
||||
// FundingCustomBlob returns the custom funding blob of the channel that this
|
||||
// link is associated with. The funding blob represents static information about
|
||||
// the channel that was created at channel funding time.
|
||||
func (l *channelLink) FundingCustomBlob() fn.Option[tlv.Blob] {
|
||||
if l.channel == nil {
|
||||
return fn.None[tlv.Blob]()
|
||||
}
|
||||
|
||||
if l.channel.State() == nil {
|
||||
return fn.None[tlv.Blob]()
|
||||
}
|
||||
|
||||
return l.channel.State().CustomBlob
|
||||
}
|
||||
|
||||
// CommitmentCustomBlob returns the custom blob of the current local commitment
|
||||
// of the channel that this link is associated with.
|
||||
func (l *channelLink) CommitmentCustomBlob() fn.Option[tlv.Blob] {
|
||||
if l.channel == nil {
|
||||
return fn.None[tlv.Blob]()
|
||||
}
|
||||
|
||||
return l.channel.LocalCommitmentBlob()
|
||||
}
|
||||
|
Reference in New Issue
Block a user