mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 17:52:25 +01:00
htlcswitch: expose custom channel blob from link
This commit is contained in:
parent
4b020caac7
commit
4a4724dc12
@ -12,6 +12,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/record"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
)
|
||||
|
||||
// InvoiceDatabase is an interface which represents the persistent subsystem
|
||||
@ -271,6 +272,10 @@ type ChannelLink interface {
|
||||
// have buffered messages.
|
||||
AttachMailBox(MailBox)
|
||||
|
||||
// ChannelCustomBlob returns the custom blob of the channel that this
|
||||
// link is associated with.
|
||||
ChannelCustomBlob() fn.Option[tlv.Blob]
|
||||
|
||||
// Start/Stop are used to initiate the start/stop of the channel link
|
||||
// functioning.
|
||||
Start() error
|
||||
|
@ -30,6 +30,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/queue"
|
||||
"github.com/lightningnetwork/lnd/ticker"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -3752,3 +3753,9 @@ func (l *channelLink) fail(linkErr LinkFailureError,
|
||||
l.failed = true
|
||||
l.cfg.OnChannelFailure(l.ChanID(), l.ShortChanID(), linkErr)
|
||||
}
|
||||
|
||||
// ChannelCustomBlob returns the custom blob of the channel that this link is
|
||||
// associated with.
|
||||
func (l *channelLink) ChannelCustomBlob() fn.Option[tlv.Blob] {
|
||||
return l.channel.State().CustomBlob
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/channeldb/models"
|
||||
"github.com/lightningnetwork/lnd/clock"
|
||||
"github.com/lightningnetwork/lnd/contractcourt"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch/hop"
|
||||
"github.com/lightningnetwork/lnd/invoices"
|
||||
"github.com/lightningnetwork/lnd/lnpeer"
|
||||
@ -35,6 +36,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/ticker"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
)
|
||||
|
||||
func isAlias(scid lnwire.ShortChannelID) bool {
|
||||
@ -912,6 +914,10 @@ func (f *mockChannelLink) ChannelPoint() wire.OutPoint {
|
||||
return wire.OutPoint{}
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) ChannelCustomBlob() fn.Option[tlv.Blob] {
|
||||
return fn.Option[tlv.Blob]{}
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) Stop() {}
|
||||
func (f *mockChannelLink) EligibleToForward() bool { return f.eligible }
|
||||
func (f *mockChannelLink) MayAddOutgoingHtlc(lnwire.MilliSatoshi) error { return nil }
|
||||
|
Loading…
x
Reference in New Issue
Block a user