htlcswitch/link: add ChannelPoint() to retrieve the channel outpoint.
This function will be used in the switch to retrieve the channel point for a link, allowing the switch to retrieve individual channels from the database.
This commit is contained in:
parent
5405028948
commit
f6cffa8f4b
@ -1,6 +1,7 @@
|
||||
package htlcswitch
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/lnpeer"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
@ -58,6 +59,9 @@ type ChannelLink interface {
|
||||
// possible).
|
||||
HandleChannelUpdate(lnwire.Message)
|
||||
|
||||
// ChannelPoint returns the channel outpoint for the channel link.
|
||||
ChannelPoint() *wire.OutPoint
|
||||
|
||||
// ChanID returns the channel ID for the channel link. The channel ID
|
||||
// is a more compact representation of a channel's full outpoint.
|
||||
ChanID() lnwire.ChannelID
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/go-errors/errors"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
@ -1743,6 +1744,12 @@ func (l *channelLink) Peer() lnpeer.Peer {
|
||||
return l.cfg.Peer
|
||||
}
|
||||
|
||||
// ChannelPoint returns the channel outpoint for the channel link.
|
||||
// NOTE: Part of the ChannelLink interface.
|
||||
func (l *channelLink) ChannelPoint() *wire.OutPoint {
|
||||
return l.channel.ChannelPoint()
|
||||
}
|
||||
|
||||
// ShortChanID returns the short channel ID for the channel link. The short
|
||||
// channel ID encodes the exact location in the main chain that the original
|
||||
// funding output can be found.
|
||||
|
@ -673,6 +673,7 @@ func (f *mockChannelLink) ChanID() lnwire.ChannelID { return
|
||||
func (f *mockChannelLink) ShortChanID() lnwire.ShortChannelID { return f.shortChanID }
|
||||
func (f *mockChannelLink) Bandwidth() lnwire.MilliSatoshi { return 99999999 }
|
||||
func (f *mockChannelLink) Peer() lnpeer.Peer { return f.peer }
|
||||
func (f *mockChannelLink) ChannelPoint() *wire.OutPoint { return &wire.OutPoint{} }
|
||||
func (f *mockChannelLink) Stop() {}
|
||||
func (f *mockChannelLink) EligibleToForward() bool { return f.eligible }
|
||||
func (f *mockChannelLink) setLiveShortChanID(sid lnwire.ShortChannelID) { f.shortChanID = sid }
|
||||
|
Loading…
Reference in New Issue
Block a user